diff options
| author | Thibault Delavallée <tde@odoo.com> | 2019-06-27 17:34:48 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-07-18 09:19:04 +0000 |
| commit | ed4c67adb2dc1eb821a72f5286452b8c5889f4fe (patch) | |
| tree | b9fed39b7b7f40de041105908921c8f06ded98c0 /addons/crm_sms | |
| parent | f18a089ca977bcc2c165e5fcebc440250cacb99f (diff) | |
[ADD] crm_sms: integrate SMS in CRM
PURPOSE
We want to integrate SMS with crm.lead in the same way it is integrated
with res.partner.
SPECIFICATION
Add phone/SMS widget on 'phone' and 'mobile' to call the same 'Send sms' modal
than on partner. This modal can also be called from the action menu in list
view. This modal should behave the same as for res.partner (same number
selection and warnings). The SMS text message should also be logged in the
chatter (similarly to res.partner)
SMS sent in batch should be logged in the chatter of the corresponding record.
Linked to task 1925950
Part of PR #34864
Diffstat (limited to 'addons/crm_sms')
| -rw-r--r-- | addons/crm_sms/__init__.py | 4 | ||||
| -rw-r--r-- | addons/crm_sms/__manifest__.py | 17 | ||||
| -rw-r--r-- | addons/crm_sms/models/__init__.py | 4 | ||||
| -rw-r--r-- | addons/crm_sms/models/crm_lead.py | 13 | ||||
| -rw-r--r-- | addons/crm_sms/views/crm_lead_views.xml | 27 |
5 files changed, 65 insertions, 0 deletions
diff --git a/addons/crm_sms/__init__.py b/addons/crm_sms/__init__.py new file mode 100644 index 00000000000..dc5e6b693d1 --- /dev/null +++ b/addons/crm_sms/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import models diff --git a/addons/crm_sms/__manifest__.py b/addons/crm_sms/__manifest__.py new file mode 100644 index 00000000000..cc3c7ab58b4 --- /dev/null +++ b/addons/crm_sms/__manifest__.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +{ + 'name': 'SMS in CRM', + 'version': '1.0', + 'category': 'Hidden', + 'summary': 'Add SMS capabilities to CRM', + 'description': "", + 'depends': ['crm', 'sms'], + 'data': [ + 'views/crm_lead_views.xml', + ], + 'installable': True, + 'application': False, + 'auto_install': True, +} diff --git a/addons/crm_sms/models/__init__.py b/addons/crm_sms/models/__init__.py new file mode 100644 index 00000000000..00140f99c9f --- /dev/null +++ b/addons/crm_sms/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import crm_lead diff --git a/addons/crm_sms/models/crm_lead.py b/addons/crm_sms/models/crm_lead.py new file mode 100644 index 00000000000..5f4fb88981c --- /dev/null +++ b/addons/crm_sms/models/crm_lead.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + + +class CrmLead(models.AbstractModel): + _inherit = 'crm.lead' + + def _sms_get_number_fields(self): + """ This method returns the fields to use to find the number to use to + send an SMS on a record. """ + return ['mobile', 'phone'] diff --git a/addons/crm_sms/views/crm_lead_views.xml b/addons/crm_sms/views/crm_lead_views.xml new file mode 100644 index 00000000000..2b08fa5631f --- /dev/null +++ b/addons/crm_sms/views/crm_lead_views.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <!-- Add action entry in the Action Menu for Leads --> + <act_window id="crm_lead_act_window_sms_composer_single" + name="Send SMS Text Message" + binding_model="crm.lead" + res_model="sms.composer" + binding_views="list" + view_mode="form" + target="new" + context="{ + 'default_composition_mode': 'mass', + 'default_mass_keep_log': True, + }" + /> + <act_window id="crm_lead_act_window_sms_composer_multi" + name="Send SMS Text Message" + binding_model="crm.lead" + res_model="sms.composer" + binding_views="form" + view_mode="form" + target="new" + context="{ + 'default_composition_mode': 'comment', + }" + /> +</odoo>
\ No newline at end of file |
