Check purchase amount is not None on compute production cost
Closes #12946 (grafted from dd9635826c8a493f4268690a47d37ee039b2d65a) --HG-- branch : 7.0
This commit is contained in:
1 parent
fbcd4bb2ad
commit
b472303f67
1 file changed
+1
-1
@@ -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