Skip to content

Commit

Permalink
[FIX] joint_buying_product: fix bug introduced by #106. do not raise …
Browse files Browse the repository at this point in the history
…an error if user is not member of LOG group
  • Loading branch information
legalsylvain committed Nov 18, 2024
1 parent e5d5335 commit 3ccd123
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions joint_buying_product/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def _compute_joint_buying_grouped_order_qty(self):

@api.constrains("joint_buying_use_category", "joint_buying_frequency_ids")
def _check_joint_buying_use_category(self):
for partner in self.filtered(lambda x: not x.joint_buying_use_category):
if partner.mapped("joint_buying_frequency_ids.category_ids"):
for partner in self.filtered(lambda x: x.is_joint_buying):
if not partner.joint_buying_use_category and partner.mapped(
"joint_buying_frequency_ids.category_ids"
):
raise ValidationError(
_(
"You can not uncheck 'Use Order Categories'"
Expand Down

0 comments on commit 3ccd123

Please sign in to comment.