From fe5e0210d9e42b30e9f50b85975906dbe99516bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80ngel=20=C3=80lvarez?= Date: Fri, 9 Sep 2022 09:10:36 +0200 Subject: [PATCH] check if uom and quantity is set --- operation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/operation.py b/operation.py index 985b4cf..f4672b3 100644 --- a/operation.py +++ b/operation.py @@ -161,6 +161,8 @@ class Operation(sequence_ordered(), Workflow, ModelSQL, ModelView): total = 0. for line in self.lines: + if not line.uom or not line.quantity: + continue total += Uom.compute_qty(line.uom, line.quantity, self.work_center_category.uom) return total