Provide digits from unit of measure
issue10677 review365801002
This commit is contained in:
+1
-11
@@ -272,9 +272,7 @@ class QuotationLine(ModelSQL, ModelView):
|
||||
'required': ~Eval('product')
|
||||
},
|
||||
depends=['product'])
|
||||
quantity = fields.Float(
|
||||
'Quantity', digits=(16, Eval('unit_digits', 2)), required=True,
|
||||
depends=['unit_digits'])
|
||||
quantity = fields.Float("Quantity", digits='unit', required=True)
|
||||
unit = fields.Many2One(
|
||||
'product.uom', 'Unit', ondelete='RESTRICT',
|
||||
states={
|
||||
@@ -286,8 +284,6 @@ class QuotationLine(ModelSQL, ModelView):
|
||||
('category', '!=', -1)),
|
||||
],
|
||||
depends=['product', 'product_uom_category'])
|
||||
unit_digits = fields.Function(
|
||||
fields.Integer('Unit Digits'), 'on_change_with_unit_digits')
|
||||
product_uom_category = fields.Function(
|
||||
fields.Many2One('product.uom.category', 'Product Uom Category'),
|
||||
'on_change_with_product_uom_category')
|
||||
@@ -354,12 +350,6 @@ class QuotationLine(ModelSQL, ModelView):
|
||||
self.currency = self.request.company.currency
|
||||
self.supply_date = self.request.supply_date or datetime.date.max
|
||||
|
||||
@fields.depends('unit')
|
||||
def on_change_with_unit_digits(self, name=None):
|
||||
if self.unit:
|
||||
return self.unit.digits
|
||||
return None
|
||||
|
||||
@fields.depends('product')
|
||||
def on_change_with_product_uom_category(self, name=None):
|
||||
if self.product:
|
||||
|
||||
+1
-1
@@ -689,7 +689,7 @@
|
||||
<text:p text:style-name="P26"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tableau1.A3" office:value-type="string">
|
||||
<text:p text:style-name="P17"><text:placeholder text:placeholder-type="text"><(format_number(quotation_line.quantity, quotation.supplier.lang, digits=quotation_line.unit_digits) + (quotation_line.unit and (' ' + quotation_line.unit.symbol) or '')) or ''></text:placeholder></text:p>
|
||||
<text:p text:style-name="P17"><text:placeholder text:placeholder-type="text"><(format_number(quotation_line.quantity, quotation.supplier.lang, digits=quotation_line.unit.digits if quotation_line.unit else None) + (quotation_line.unit and (' ' + quotation_line.unit.symbol) or '')) or ''></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tableau1.A3" office:value-type="string">
|
||||
<text:p text:style-name="P17"><text:placeholder text:placeholder-type="text"><format_currency(quotation_line.unit_price, quotation.supplier.lang, quotation_line.currency, digits=quotation_line.__class__.unit_price.digits[1]) if quotation_line.unit_price else ""></text:placeholder></text:p>
|
||||
|
||||
Reference in New Issue
Block a user