From d08a80d27074c1ee1b92689922271fb869d90815 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Tue, 7 Nov 2023 16:59:10 +0100 Subject: [PATCH] Fix tests. --- plan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plan.py b/plan.py index 7accf8b..c0c0d52 100644 --- a/plan.py +++ b/plan.py @@ -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: