Enforce the same company, currency and party when the payment origin is a sale

Closes #14237
This commit is contained in:
Cédric Krier
2025-09-17 16:28:04 +02:00
parent c76a97868a
commit b934cd7b4e
+11
View File
@@ -36,6 +36,17 @@ class Payment(metaclass=PoolMeta):
If(Eval('state') == 'draft',
('state', '!=', 'cancelled'),
()),
('company', '=', Eval('company', -1)),
If(Eval('state') == 'draft',
['OR',
('invoice_party', '=', Eval('party', -1)),
[
('invoice_party', '=', None),
('party', '=', Eval('party', -1)),
],
],
[]),
('currency', '=', Eval('currency', -1)),
]
@classmethod