Skip to content

Commit

Permalink
Merge PR #78 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Dec 19, 2023
2 parents ea6ec67 + 82ad683 commit b8489d3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions joint_buying_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class SaleOrder(models.Model):
joint_buying_transport_request_id = fields.Many2one(
comodel_name="joint.buying.transport.request",
compute="_compute_joint_buying_transport_request_id",
compute_sudo=True,
)

joint_buying_transport_request_ids = fields.One2many(
Expand All @@ -24,9 +25,10 @@ class SaleOrder(models.Model):

@api.depends("joint_buying_transport_request_ids")
def _compute_joint_buying_transport_request_id(self):
for order in self.sudo():
for order in self:
sudo_order = order.sudo()
order.joint_buying_transport_request_id = (
order.joint_buying_transport_request_ids
and order.joint_buying_transport_request_ids[0]
sudo_order.joint_buying_transport_request_ids
and sudo_order.joint_buying_transport_request_ids[0]
or False
)

0 comments on commit b8489d3

Please sign in to comment.