From 8ef1543908b482820186f60a976bc44808b0c600 Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Thu, 5 Sep 2019 14:41:11 +0000 Subject: [PATCH 1/4] [FIX] sms - mass_mailing: fix some bugs - Cancel button in the sms form view not related to a action : When we click on the cancel button of the sms form view, get traceback. Fix the issue by adding the cancel action in sms model. - Mass mailing contact - False as the display name : The display name was the mail address but when the contact didn't have mail address a ugly False was print to described the contact (form view). Then change the _rec_name to print the name as the display name. - Fix SMS composer for the res.parnter tree Only the first record was truely selected when open the sms composer (mass) from the tree view of partner. Fix that by bind the actives_ids in the context and also fix the names of related actions. TASK_ID : 2053631 --- addons/mass_mailing/models/mailing_contact.py | 1 - addons/sms/models/sms_sms.py | 3 +++ addons/sms/views/res_partner_views.xml | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/mass_mailing/models/mailing_contact.py b/addons/mass_mailing/models/mailing_contact.py index e50b36534e4..ea25ce31936 100644 --- a/addons/mass_mailing/models/mailing_contact.py +++ b/addons/mass_mailing/models/mailing_contact.py @@ -48,7 +48,6 @@ class MassMailingContact(models.Model): _inherit = ['mail.thread.blacklist'] _description = 'Mass Mailing Contact' _order = 'email' - _rec_name = 'email' name = fields.Char() company_name = fields.Char(string='Company Name') diff --git a/addons/sms/models/sms_sms.py b/addons/sms/models/sms_sms.py index 9ea635b2070..8bf9c8c2924 100644 --- a/addons/sms/models/sms_sms.py +++ b/addons/sms/models/sms_sms.py @@ -56,6 +56,9 @@ class SmsSms(models.Model): if auto_commit is True and not getattr(threading.currentThread(), 'testing', False): self._cr.commit() + def cancel(self): + self.state = 'canceled' + @api.model def _process_queue(self, ids=None): """ Send immediately queued messages, committing after each message is sent. diff --git a/addons/sms/views/res_partner_views.xml b/addons/sms/views/res_partner_views.xml index c696531fc3b..455571be093 100644 --- a/addons/sms/views/res_partner_views.xml +++ b/addons/sms/views/res_partner_views.xml @@ -27,7 +27,7 @@ - - Date: Thu, 5 Sep 2019 14:58:23 +0000 Subject: [PATCH 2/4] [IMP] sms: allow to preview a sms template Add a way for the user to preview sms content from a sms template depending of a record (targeted model) and the installed languages (as for the mail template). Add button to open this preview on the form of the sms template. TASK_ID : 2053631 --- addons/sms/__manifest__.py | 1 + addons/sms/views/sms_template_views.xml | 5 ++ addons/sms/wizard/__init__.py | 1 + addons/sms/wizard/sms_template_preview.py | 53 +++++++++++++++++++ .../sms/wizard/sms_template_preview_views.xml | 42 +++++++++++++++ 5 files changed, 102 insertions(+) create mode 100644 addons/sms/wizard/sms_template_preview.py create mode 100644 addons/sms/wizard/sms_template_preview_views.xml diff --git a/addons/sms/__manifest__.py b/addons/sms/__manifest__.py index 2b15020a219..90462b4c8fb 100644 --- a/addons/sms/__manifest__.py +++ b/addons/sms/__manifest__.py @@ -16,6 +16,7 @@ The service is provided by the In App Purchase Odoo platform. 'data/ir_cron_data.xml', 'wizard/sms_cancel_views.xml', 'wizard/sms_composer_views.xml', + 'wizard/sms_template_preview_views.xml', 'wizard/sms_resend_views.xml', 'views/ir_actions_views.xml', 'views/res_config_settings_views.xml', diff --git a/addons/sms/views/sms_template_views.xml b/addons/sms/views/sms_template_views.xml index 1f339e4d944..24acfcac134 100644 --- a/addons/sms/views/sms_template_views.xml +++ b/addons/sms/views/sms_template_views.xml @@ -6,6 +6,11 @@
+
+