Check purchase amount is not None on compute production cost
Closes #12946
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user