Avoid reading all category uoms when testing uom.category
issue5982 review25761002
This commit is contained in:
1 parent
2d9e6c93e2
commit
b238b0c64c
2 files changed
+4
-4
No files matched your search
@@ -89,8 +89,8 @@ class BOMInput(ModelSQL, ModelView):
|
||||
@fields.depends('product', 'uom')
|
||||
def on_change_product(self):
|
||||
if self.product:
|
||||
uoms = self.product.default_uom.category.uoms
|
||||
if (not self.uom or self.uom not in uoms):
|
||||
category = self.product.default_uom.category
|
||||
if not self.uom or self.uom.category != category:
|
||||
self.uom = self.product.default_uom
|
||||
self.unit_digits = self.product.default_uom.digits
|
||||
else:
|
||||
|
||||
+2
-2
@@ -346,8 +346,8 @@ class Production(Workflow, ModelSQL, ModelView):
|
||||
@fields.depends(*BOM_CHANGES)
|
||||
def on_change_product(self):
|
||||
if self.product:
|
||||
uoms = self.product.default_uom.category.uoms
|
||||
if (not self.uom or self.uom not in uoms):
|
||||
category = self.product.default_uom.category
|
||||
if not self.uom or self.uom.category != category:
|
||||
self.uom = self.product.default_uom
|
||||
self.unit_digits = self.product.default_uom.digits
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user