Skip to content

Commit

Permalink
[IMP] purchase_operating_unit - replace constraint on company with ch…
Browse files Browse the repository at this point in the history
…eck_company
  • Loading branch information
jdidderen-nsi committed May 30, 2024
1 parent cfb0a9f commit 7ed9897
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion purchase_operating_unit/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand Down Expand Up @@ -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,
)

0 comments on commit 7ed9897

Please sign in to comment.