diff options
| author | Florimond Husquinet (fhu) <fhu@odoo.com> | 2019-11-15 13:21:02 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-03-05 11:27:01 +0000 |
| commit | f685e70616e8fe357690cd8e6cfa4543c1d0df24 (patch) | |
| tree | 6b818d3e3ae89d0ba9de2530d24296145883a3ca /addons/sms/models | |
| parent | e36661ecd9fc455222f4d274eb65ab763a6ccd18 (diff) | |
[IMP] sms: allow to edit number when sending an SMS to one recipient
After this commit
* the SMS button is visible next to a phone number in mass_mailing, and
mass_mailing_sms
* when sending an sms to a single contact, its phone number is now an
editable field in the wizard and there is a warning if the number is
invalid;
* if operator updated the recipient number, update record number according
to the new number only in single recipient mode (aka, solving number
issues directly from interface);
LINKS
Task ID 2088303
Community PR odoo/odoo#40482
Upgrade PR odoo/upgrade#873
Co-Authored-By: Florimond Husquinet <fhu@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Diffstat (limited to 'addons/sms/models')
| -rw-r--r-- | addons/sms/models/mail_thread.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/addons/sms/models/mail_thread.py b/addons/sms/models/mail_thread.py index e1dac1fba33..86713fddc24 100644 --- a/addons/sms/models/mail_thread.py +++ b/addons/sms/models/mail_thread.py @@ -128,11 +128,8 @@ class MailThread(models.AbstractModel): 'partner_store': True, 'field_store': fname, } - elif all_numbers: - result[record.id] = {'partner': self.env['res.partner'], 'sanitized': False, 'number': all_numbers[0]} else: - idx, value = next(((idx, val) for idx, val in enumerate(all_numbers)), (0, False)) - fname = tocheck_fields[idx] if tocheck_fields else False + value, fname = next(((value, fname) for value, fname in zip(all_numbers, tocheck_fields) if value), (0, False)) result[record.id] = { 'partner': self.env['res.partner'], 'sanitized': False, |
