diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 249fea89e0e..25885598f89 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -28,6 +28,7 @@ import pooler import re import time import tools +from openerp.loglevels import ustr def get_datetime(date_field): @@ -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 3947eb58156..27ee6e49d6f 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -27,6 +27,7 @@ from osv import fields from osv import osv import crm +from openerp.loglevels import ustr class base_action_rule(osv.osv): """ Base Action Rule """ @@ -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