Copy invoice lines when synchronizing shipment moves
issue9114 review273011002
This commit is contained in:
@@ -11,4 +11,5 @@ def register():
|
||||
account.InvoiceLineStockMove,
|
||||
account.InvoiceLine,
|
||||
stock.Move,
|
||||
stock.ShipmentOut,
|
||||
module='account_invoice_stock', type_='model')
|
||||
|
||||
@@ -62,3 +62,13 @@ class Move(metaclass=PoolMeta):
|
||||
if not Transaction().context.get('_stock_move_split'):
|
||||
default.setdefault('invoice_lines', None)
|
||||
return super().copy(moves, default=default)
|
||||
|
||||
|
||||
class ShipmentOut(metaclass=PoolMeta):
|
||||
__name__ = 'stock.shipment.out'
|
||||
|
||||
def _sync_outgoing_move(self, template=None):
|
||||
move = super()._sync_outgoing_move(template=template)
|
||||
if template and template.invoice_lines:
|
||||
move.invoice_lines = list(template.invoice_lines)
|
||||
return move
|
||||
|
||||
Reference in New Issue
Block a user