Enforce company of promotion using the sale line company field

This commit is contained in:
Cédric Krier committed 2024-10-25 17:06:42 +02:00
1 parent 67e200848d
commit 59a0a8c8a7
1 file changed
+3 -4
+3 -4
View File
@@ -74,12 +74,11 @@ class Line(metaclass=PoolMeta):
draft_unit_price = fields.Numeric('Draft Unit Price',
digits=price_digits, readonly=True)
promotion = fields.Many2One('sale.promotion', 'Promotion',
promotion = fields.Many2One('sale.promotion', "Promotion",
ondelete='RESTRICT',
domain=[
('company', '=', Eval('_parent_sale', {}).get('company', -1)),
],
depends={'sale'})
('company', '=', Eval('company', -1)),
])
class Promotion(