diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 9fdb29a19f6..e7427f36e75 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -1173,28 +1173,6 @@ class Lead(models.Model): defaults.update(custom_values) return super(Lead, self).message_new(msg_dict, custom_values=defaults) - @api.multi - def message_update(self, msg_dict, update_vals=None): - """ Overrides mail_thread message_update that is called by the mailgateway - through message_process. - This method updates the document according to the email. - """ - if update_vals is None: - update_vals = {} - if msg_dict.get('priority') in dict(crm_stage.AVAILABLE_PRIORITIES): - update_vals['priority'] = msg_dict.get('priority') - maps = { - 'revenue': 'planned_revenue', - 'probability': 'probability', - } - for line in msg_dict.get('body', '').split('\n'): - line = line.strip() - 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() - return super(Lead, self).message_update(msg_dict, update_vals=update_vals) - def _message_post_after_hook(self, message, values, notif_layout, notif_values): if self.email_from and not self.partner_id: # we consider that posting a message with a specified recipient (not a follower, a specific one) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 8a7ef37a487..11bb6b9314e 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -935,23 +935,6 @@ class Task(models.Model): @api.multi def message_update(self, msg, update_vals=None): """ Override to update the task according to the email. """ - if update_vals is None: - update_vals = {} - maps = { - 'cost': 'planned_hours', - } - for line in msg['body'].split('\n'): - line = line.strip() - res = tools.command_re.match(line) - if res: - match = res.group(1).lower() - field = maps.get(match) - if field: - try: - update_vals[field] = float(res.group(2).lower()) - except (ValueError, TypeError): - pass - email_list = self.email_split(msg) partner_ids = [p for p in self._find_partner_from_emails(email_list, force_create=False) if p] self.message_subscribe(partner_ids) diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py index ce1ccb90e3a..0b4608c62e3 100644 --- a/odoo/tools/mail.py +++ b/odoo/tools/mail.py @@ -415,9 +415,6 @@ email_re = re.compile(r"""([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63})""", # matches a string containing only one email single_email_re = re.compile(r"""^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$""", re.VERBOSE) -# update command in emails body -command_re = re.compile("^Set-([a-z]+) *: *(.+)$", re.I + re.UNICODE) - # Updated in 7.0 to match the model name as well # Typical form of references is # group(1) = the record ID ; group(2) = the model (if any) ; group(3) = the domain