check if uom and quantity is set

This commit is contained in:
Àngel Àlvarez 2022-09-09 09:10:36 +02:00
parent 05a14c71f8
commit fe5e0210d9
1 changed files with 2 additions and 0 deletions

View File

@ -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