diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 249fea89e0e..50ebd96a3c2 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -24,6 +24,7 @@ from tools.translate import _ from datetime import datetime from datetime import timedelta from tools.safe_eval import safe_eval +from tools import ustr import pooler import re import time @@ -369,8 +370,8 @@ the rule to mark CC(mail to any other person defined in actions)."), reg_name = action.regex_name result_name = True if reg_name: - ptrn = re.compile(str(reg_name)) - _result = ptrn.search(str(obj.name)) + ptrn = re.compile(ustr(reg_name)) + _result = ptrn.search(ustr(obj.name)) if not _result: result_name = False regex_n = not reg_name or result_name diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 76876df81e7..ec489ff4d14 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -23,6 +23,7 @@ import re import tools from tools.translate import _ +from tools import ustr from osv import fields from osv import osv @@ -73,9 +74,9 @@ class base_action_rule(osv.osv): regex = action.regex_history if regex: res = False - ptrn = re.compile(str(regex)) + ptrn = re.compile(ustr(regex)) for history in obj.message_ids: - _result = ptrn.search(str(history.name)) + _result = ptrn.search(ustr(history.subject)) if _result: res = True break