From cbfc5ab26eb6d1ccd33af11deb5fdc7da7c33991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 16 Dec 2020 21:24:07 +0100 Subject: [PATCH] Enforce currency, invoice_type and party values between invoice and lines The currency of an invoice line must always be the same as the invoice. For the invoice_type and party they must be the same only if set. issue9854 review324581002 --- invoice.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/invoice.py b/invoice.py index 546381d959..3aac84a7c0 100644 --- a/invoice.py +++ b/invoice.py @@ -1,6 +1,5 @@ # 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.pyson import Eval from trytond.transaction import Transaction from trytond.pool import PoolMeta @@ -12,13 +11,8 @@ class Invoice(metaclass=PoolMeta): def __setup__(cls): super(Invoice, cls).__setup__() add_remove = [ - ('invoice_type', '=', Eval('type')), - ('party', '=', Eval('party')), - ('currency', '=', Eval('currency')), - ('company', '=', Eval('company')), ('invoice', '=', None), ] - add_remove_depends = set(['type', 'party', 'currency', 'company']) if not cls.lines.add_remove: cls.lines.add_remove = add_remove @@ -27,7 +21,6 @@ class Invoice(metaclass=PoolMeta): add_remove, cls.lines.add_remove, ] - cls.lines.depends = list(set(cls.lines.depends) | add_remove_depends) class InvoiceLine(metaclass=PoolMeta):