changeset a777306fdf1d in modules/stock_package:default
details:
https://hg.tryton.org/modules/stock_package?cmd=changeset&node=a777306fdf1d
description:
Use packaging_weight_uom as digits
issue11124
review374621002
diffstat:
stock.py | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diffs (29 lines):
diff -r afce611750b3 -r a777306fdf1d stock.py
--- a/stock.py Sat Dec 18 16:34:36 2021 +0100
+++ b/stock.py Sun Jan 30 01:30:26 2022 +0100
@@ -81,8 +81,7 @@
__slots__ = ()
packaging_weight = fields.Float(
- "Packaging Weight", digits=(16, Eval('packaging_weight_digits', 2)),
- depends=['packaging_weight_digits'],
+ "Packaging Weight", digits='packaging_weight_uom',
help="The weight of the package when empty.")
packaging_weight_uom = fields.Many2One(
'product.uom', "Packaging Weight Uom",
@@ -91,15 +90,6 @@
'required': Bool(Eval('packaging_weight')),
},
depends=['packaging_weight'])
- packaging_weight_digits = fields.Function(
- fields.Integer("Packaging Weight Digits"),
- 'on_change_with_packaging_weight_digits')
-
- @fields.depends('packaging_weight_uom')
- def on_change_with_packaging_weight_digits(self, name=None):
- return (
- self.packaging_weight_uom.digits if self.packaging_weight_uom
- else None)
class Package(tree(), WeightMixin, ModelSQL, ModelView):