From ac41c6912b8a41bedab97af9357a827f9776dc09 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Tue, 7 Sep 2010 14:53:21 +0530 Subject: [PATCH] [FIX]: crm: Consider only email communication history in max_history of action rule bzr revid: rpa@tinyerp.com-20100907092321-k4u26gmvit9cozab --- addons/crm/crm_action_rule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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