Check purchase amount is not None on compute production cost

Closes #12946
This commit is contained in:
Adrià Tarroja Caubet
2024-01-18 10:38:07 +01:00
parent 8dc2186c94
commit 0d71ab5440
+1 -1
View File
@@ -118,7 +118,7 @@ class Production(metaclass=PoolMeta):
Currency = pool.get('currency.currency')
cost = super(Production, self).get_cost(name)
for line in self.purchase_lines:
if line.purchase.state != 'cancelled':
if line.purchase.state != 'cancelled' and line.amount:
cost += Currency.compute(
line.purchase.currency, line.amount,
self.company.currency, round=False)