diff --git a/account.py b/account.py index 60d853d280..64dca57111 100644 --- a/account.py +++ b/account.py @@ -38,3 +38,12 @@ class InvoiceLine: quantity += Uom.compute_qty(stock_move.uom, stock_move.quantity, self.unit) return quantity + + @classmethod + def copy(cls, lines, default=None): + if default is None: + default = {} + else: + default = default.copy() + default.setdefault('stock_moves', None) + return super(InvoiceLine, cls).copy(lines, default=default) diff --git a/stock.py b/stock.py index 1e41bda3d4..14dcf4a2fc 100644 --- a/stock.py +++ b/stock.py @@ -23,3 +23,12 @@ class StockMove: quantity += Uom.compute_qty(invoice_line.unit, invoice_line.quantity, self.uom) return quantity + + @classmethod + def copy(cls, moves, default=None): + if default is None: + default = {} + else: + default = default.copy() + default.setdefault('invoice_lines', None) + return super(StockMove, cls).copy(moves, default=default)