Files
tryton/modules/sale_shipment_cost/account.py
T
Maxime Richez dd946e1ad4 Do not copy cost shipments when copying invoice lines
Closes #13372
(grafted from 20a741abf07af4acd9bb558eb6eb462e69873028)

--HG--
branch : 7.0
2024-09-08 16:56:17 +02:00

19 lines
649 B
Python

# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
class InvoiceLine(metaclass=PoolMeta):
__name__ = 'account.invoice.line'
cost_shipments = fields.One2Many(
'stock.shipment.out', 'cost_invoice_line', "Cost of Shipments",
readonly=True)
@classmethod
def copy(cls, lines, default=None):
default = default.copy() if default is not None else {}
default.setdefault('cost_shipments', None)
return super().copy(lines, default=default)