diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 877cc25404f..ae9537072a2 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -832,7 +832,7 @@ class crm_lead(base_stage, format_address, osv.osv): } for line in msg.get('body', '').split('\n'): line = line.strip() - res = tools.misc.command_re.match(line) + res = tools.command_re.match(line) if res and maps.get(res.group(1).lower()): key = maps.get(res.group(1).lower()) update_vals[key] = res.group(2).lower() diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index 8308e5420d0..70dcc18baf7 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -224,7 +224,7 @@ class crm_claim(base_stage, osv.osv): } for line in msg['body'].split('\n'): line = line.strip() - res = tools.misc.command_re.match(line) + res = tools.command_re.match(line) if res and maps.get(res.group(1).lower()): key = maps.get(res.group(1).lower()) update_vals[key] = res.group(2).lower() diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index 276dd0b4b49..373cf53aed6 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -133,7 +133,7 @@ class crm_helpdesk(base_state, base_stage, osv.osv): } for line in msg['body'].split('\n'): line = line.strip() - res = tools.misc.command_re.match(line) + res = tools.command_re.match(line) if res and maps.get(res.group(1).lower()): key = maps.get(res.group(1).lower()) update_vals[key] = res.group(2).lower() diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 155f20daf4d..de1539da55a 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -356,7 +356,8 @@ class hr_applicant(base_stage, osv.Model): """ if isinstance(ids, (str, int, long)): ids = [ids] - if update_vals is None: vals = {} + if update_vals is None: + update_vals = {} update_vals.update({ 'description': msg.get('body'), @@ -373,12 +374,12 @@ class hr_applicant(base_stage, osv.Model): } for line in msg.get('body', '').split('\n'): line = line.strip() - res = tools.misc.command_re.match(line) + res = tools.command_re.match(line) if res and maps.get(res.group(1).lower(), False): key = maps.get(res.group(1).lower()) update_vals[key] = res.group(2).lower() - return super(hr_applicant, self).message_update(cr, uids, ids, update_vals=update_vals, context=context) + return super(hr_applicant, self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context) def create(self, cr, uid, vals, context=None): obj_id = super(hr_applicant, self).create(cr, uid, vals, context=context) @@ -420,7 +421,7 @@ class hr_applicant(base_stage, osv.Model): self.write(cr, uid, [applicant.id], {'emp_id': emp_id}, context=context) self.case_close(cr, uid, [applicant.id], context) else: - raise osv.except_osv(_('Warning!'),_('You must define Applied Job for this applicant.')) + raise osv.except_osv(_('Warning!'), _('You must define Applied Job for this applicant.')) action_model, action_id = model_data.get_object_reference(cr, uid, 'hr', 'open_view_employee_list') dict_act_window = act_window.read(cr, uid, action_id, []) @@ -433,13 +434,13 @@ class hr_applicant(base_stage, osv.Model): """Overrides cancel for crm_case for setting probability """ res = super(hr_applicant, self).case_cancel(cr, uid, ids, context) - self.write(cr, uid, ids, {'probability' : 0.0}) + self.write(cr, uid, ids, {'probability': 0.0}) return res def case_pending(self, cr, uid, ids, context=None): """Marks case as pending""" res = super(hr_applicant, self).case_pending(cr, uid, ids, context) - self.write(cr, uid, ids, {'probability' : 0.0}) + self.write(cr, uid, ids, {'probability': 0.0}) return res def case_reset(self, cr, uid, ids, context=None): @@ -452,7 +453,7 @@ class hr_applicant(base_stage, osv.Model): def set_priority(self, cr, uid, ids, priority, *args): """Set applicant priority """ - return self.write(cr, uid, ids, {'priority' : priority}) + return self.write(cr, uid, ids, {'priority': priority}) def set_high_priority(self, cr, uid, ids, *args): """Set applicant priority to high @@ -475,7 +476,7 @@ class hr_applicant(base_stage, osv.Model): return self.message_post(cr, uid, ids, body=_("Stage changed to %s.") % (stage_name), context=context) def case_get_note_msg_prefix(self, cr, uid, id, context=None): - return 'Applicant' + return 'Applicant' def case_open_send_note(self, cr, uid, ids, context=None): message = _("Applicant has been set in progress.") diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index ee1a015396b..a809f7e8e2e 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -341,7 +341,7 @@ class mail_thread(osv.AbstractModel): message = self.pool.get('mail.message').browse(cr, uid, message_ids[0], context=context) _logger.debug('Routing mail with Message-Id %s: direct reply to a private message: %s, custom_values: %s, uid: %s', message_id, message.id, custom_values, uid) - return [(False, 0, custom_values, uid)] + return [(message.model, message.res_id, custom_values, uid)] # 2. Look for a matching mail.alias entry # Delivered-To is a safe bet in most modern MTAs, but we have to fallback on To + Cc values diff --git a/addons/project/project.py b/addons/project/project.py index 9c28fadeab9..68122d1a614 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -1247,7 +1247,7 @@ class task(base_stage, osv.osv): } for line in msg['body'].split('\n'): line = line.strip() - res = tools.misc.command_re.match(line) + res = tools.command_re.match(line) if res: match = res.group(1).lower() field = maps.get(match)