diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 1ca37a426a2..074821691e8 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -96,7 +96,8 @@ this if you want the rule to send an email to the partner."), res_count = True if action.trg_max_history: res_count = False - if len(obj.message_ids) >= action.trg_max_history: + history_ids = filter(lambda x: x.history, obj.message_ids) + if len(history_ids) <= action.trg_max_history: res_count = True ok = ok and res_count return ok