Skip canceled move and invoice when computing quantity
This ensures that newly recreated invoices or moves are still linked as quantity will be lower. issue9032 review258971002
This commit is contained in:
1 parent
31bf39b5db
commit
d8cb03642e
2 files changed
+6
-4
No files matched your search
+3
-2
@@ -31,8 +31,9 @@ class InvoiceLine(metaclass=PoolMeta):
|
||||
Uom = pool.get('product.uom')
|
||||
quantity = 0
|
||||
for stock_move in self.stock_moves:
|
||||
quantity += Uom.compute_qty(stock_move.uom, stock_move.quantity,
|
||||
self.unit)
|
||||
if stock_move.state != 'cancel':
|
||||
quantity += Uom.compute_qty(
|
||||
stock_move.uom, stock_move.quantity, self.unit)
|
||||
return quantity
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -17,8 +17,9 @@ class Move(metaclass=PoolMeta):
|
||||
Uom = pool.get('product.uom')
|
||||
quantity = 0
|
||||
for invoice_line in self.invoice_lines:
|
||||
quantity += Uom.compute_qty(invoice_line.unit,
|
||||
invoice_line.quantity, self.uom)
|
||||
if invoice_line.invoice_state != 'cancel':
|
||||
quantity += Uom.compute_qty(
|
||||
invoice_line.unit, invoice_line.quantity, self.uom)
|
||||
return quantity
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user