From 7ed9897f6ea7bb7240cbc28843d982105625a642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Didderen?= Date: Thu, 30 May 2024 10:52:12 +0200 Subject: [PATCH] [IMP] purchase_operating_unit - replace constraint on company with check_company --- purchase_operating_unit/models/purchase_order.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/purchase_operating_unit/models/purchase_order.py b/purchase_operating_unit/models/purchase_order.py index 132e41944c..70c708c401 100644 --- a/purchase_operating_unit/models/purchase_order.py +++ b/purchase_operating_unit/models/purchase_order.py @@ -15,6 +15,7 @@ class PurchaseOrder(models.Model): default=lambda self: ( self.env["res.users"]._get_default_operating_unit(self.env.uid) ), + check_company=True, ) requesting_operating_unit_id = fields.Many2one( @@ -23,6 +24,7 @@ class PurchaseOrder(models.Model): default=lambda self: ( self.env["res.users"]._get_default_operating_unit(self.env.uid) ), + check_company=True, ) @api.constrains("operating_unit_id", "company_id") @@ -50,5 +52,7 @@ class PurchaseOrderLine(models.Model): _inherit = "purchase.order.line" operating_unit_id = fields.Many2one( - related="order_id.operating_unit_id", string="Operating Unit" + related="order_id.operating_unit_id", + string="Operating Unit", + check_company=True, )