changeset 54d0c113b4e8 in modules/purchase_amendment:default
details: 
https://hg.tryton.org/modules/purchase_amendment?cmd=changeset&node=54d0c113b4e8
description:
        Provide digits from unit of measure

        issue10677
        review365801002
diffstat:

 purchase.py |  13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diffs (42 lines):

diff -r 9527e0f7865d -r 54d0c113b4e8 purchase.py
--- a/purchase.py       Sun Jul 04 17:54:47 2021 +0200
+++ b/purchase.py       Mon Aug 30 00:27:13 2021 +0200
@@ -262,14 +262,13 @@
             },
         depends=['product', 'party', 'state', 'action'])
     quantity = fields.Float(
-        "Quantity",
-        digits=(16, Eval('unit_digits', 2)),
+        "Quantity", digits='unit',
         states={
             'readonly': Eval('state') != 'draft',
             'invisible': Eval('action') != 'line',
             'required': Eval('action') == 'line',
             },
-        depends=['unit_digits', 'action'])
+        depends=['action'])
     unit = fields.Many2One(
         'product.uom', "Unit", ondelete='RESTRICT',
         domain=[
@@ -297,9 +296,6 @@
             },
         depends=['state', 'action'])
 
-    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')
@@ -374,11 +370,6 @@
         if self.party:
             self.invoice_address = self.party.address_get(type='invoice')
 
-    @fields.depends('unit')
-    def on_change_with_unit_digits(self, name=None):
-        if self.unit:
-            return self.unit.digits
-
     @fields.depends('line')
     def on_change_with_product_uom_category(self, name=None):
         if self.line:

Reply via email to