Compare commits
3 Commits
1abe1e99f5
...
86250e0c8a
Author | SHA1 | Date |
---|---|---|
Raimon Esteve | 86250e0c8a | |
Raimon Esteve | 470525b1a4 | |
Raimon Esteve | 2c1dfd0bd0 |
6
plan.py
6
plan.py
|
@ -555,8 +555,10 @@ class PlanProductLine(ModelSQL, ModelView, tree(separator='/')):
|
||||||
|
|
||||||
@fields.depends('children', 'product', 'plan', '_parent_plan.uom')
|
@fields.depends('children', 'product', 'plan', '_parent_plan.uom')
|
||||||
def on_change_with_uom_category(self, name=None):
|
def on_change_with_uom_category(self, name=None):
|
||||||
if self.children and self.children[0].uom:
|
if self.children:
|
||||||
return self.children[0].uom.category.id
|
uoms = set([child.uom.category for child in self.children])
|
||||||
|
if len(uoms) == 1:
|
||||||
|
return list(uoms)[0].id
|
||||||
elif self.product:
|
elif self.product:
|
||||||
return self.product.default_uom.category.id
|
return self.product.default_uom.category.id
|
||||||
elif self.plan and self.plan.uom:
|
elif self.plan and self.plan.uom:
|
||||||
|
|
Loading…
Reference in New Issue