Fix tests.

This commit is contained in:
Albert Cervera i Areny 2023-11-07 16:59:10 +01:00
parent 8d03eff9cc
commit d08a80d270
1 changed files with 2 additions and 1 deletions

View File

@ -556,7 +556,8 @@ class PlanProductLine(ModelSQL, ModelView, tree(separator='/')):
@fields.depends('children', 'product', 'plan', '_parent_plan.uom')
def on_change_with_uom_category(self, name=None):
if self.children:
uoms = set([child.uom.category for child in self.children])
uoms = set([child.uom.category for child in self.children
if child.uom])
if len(uoms) == 1:
return list(uoms)[0].id
elif self.product: