diff --git a/sale_loyalty_order_suggestion_multi_product/wizard/sale_loyalty_reward_wizard.py b/sale_loyalty_order_suggestion_multi_product/wizard/sale_loyalty_reward_wizard.py index b7f32496..99ffb53c 100644 --- a/sale_loyalty_order_suggestion_multi_product/wizard/sale_loyalty_reward_wizard.py +++ b/sale_loyalty_order_suggestion_multi_product/wizard/sale_loyalty_reward_wizard.py @@ -9,9 +9,8 @@ class SaleLoyaltyRewardWizard(models.TransientModel): @api.depends("reward_ids", "selected_reward_id") def _compute_multi_criteria(self): - self.multi_criteria = ( - self.selected_reward_id.program_id.rule_ids.loyalty_criteria - == "multi_product" + self.multi_criteria = self.selected_reward_id.program_id.rule_ids.filtered( + lambda r: r.loyalty_criteria == "multi_product" ) def _compute_loyalty_rule_line_ids(self): @@ -58,9 +57,8 @@ def _compute_loyalty_rule_line_description(self): return super()._compute_loyalty_rule_line_description() def action_apply(self): - if ( - self.selected_reward_id.program_id.rule_ids.loyalty_criteria - == "multi_product" + if self.selected_reward_id.program_id.rule_ids.filtered( + lambda r: r.loyalty_criteria == "multi_product" ): if all( line.units_to_include > 0 or line.units_included > 0