summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-03-13 15:53:37 +0100
committerThibault Delavallée <tde@odoo.com>2018-03-16 11:00:35 +0100
commitcd69ea8f9ace289977d22077e9e24b19928b705e (patch)
tree7cb39bf40d5a284a3c3a1ff353b454e345f0456c /addons
parent8a7a2c7af2d4a56104e7652a3563e1fd7596fdce (diff)
[REM] crm, project: remove support of mail-based record update
Currently crm and project parse incoming email body following an old syntax to find some "set field - value" lines in the email content. It is used to update the record linked to the discussion directly from the email. However this feature is undocumented and not really supported anymore. Moreover we don't think being able to update records from emails is a reliable way of working. Moreover those update is limited to * revenue and probably for leads; this should totally be managed from the pipeline view by lead / opportunity responsible; * priority update coming from a "priority" entry in the incoming email; this code seems strange as priority is probably not standard in email headers; * planned hours for project; this should be managed by project user and managers through dedicated views in Odoo; Let us remove that old feature and let people use desktop or mobile interface to update their records.
Diffstat (limited to 'addons')
-rw-r--r--addons/crm/models/crm_lead.py22
-rw-r--r--addons/project/models/project.py17
2 files changed, 0 insertions, 39 deletions
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)