From 3ccd123dee97a80ff0d4bf5e157d6280c3a9a8fa Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 19 Nov 2024 00:30:16 +0100 Subject: [PATCH] [FIX] joint_buying_product: fix bug introduced by https://github.com/grap/odoo-addons-logistics/pull/106. do not raise an error if user is not member of LOG group --- joint_buying_product/models/res_partner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/joint_buying_product/models/res_partner.py b/joint_buying_product/models/res_partner.py index 37a8deb2..c6f2dc0e 100644 --- a/joint_buying_product/models/res_partner.py +++ b/joint_buying_product/models/res_partner.py @@ -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'"