summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebauche Stéphane <std@odoo.com>2019-09-18 09:14:36 +0000
committerThibault Delavallée <tde@odoo.com>2019-09-20 14:05:41 +0000
commit1692d1ff3ea561c70bcd992e71913ba018f149f4 (patch)
tree67c7278a8c13363716ccfaf5d12e4a39fcd57df2
parent114c2423b307226e799c7a44483297e9446408ce (diff)
[FIX] mass_mailing: ease marketing automation inheritance
Purpose of this commit is to add an anchor in mass mailing view in order to ease some marketing automation fixes. Also reset the sms composer context when sending sms from an sms mailing as it may create some issues when sending manually an sms from a marketing activity (see enteprise). Indeed wrong participant is chosen. Task ID 2073158 (marketing automation fixes) PR #37185 PR odoo/enterprise#5693
-rw-r--r--addons/mass_mailing/views/mailing_mailing_views.xml2
-rw-r--r--addons/mass_mailing_sms/models/mailing_mailing.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/mass_mailing/views/mailing_mailing_views.xml b/addons/mass_mailing/views/mailing_mailing_views.xml
index daa6c1beeb7..727b295b9a0 100644
--- a/addons/mass_mailing/views/mailing_mailing_views.xml
+++ b/addons/mass_mailing/views/mailing_mailing_views.xml
@@ -139,7 +139,7 @@
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="subject" string="Subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="mailing_model_id" string="Recipients"/>
- <div>
+ <div name="mailing_model_id_container">
<div class="row">
<div class="col-xs-12 col-md-3" >
<field name="mailing_model_id" widget="selection" required="True"
diff --git a/addons/mass_mailing_sms/models/mailing_mailing.py b/addons/mass_mailing_sms/models/mailing_mailing.py
index 88de914331a..49d7b6a0a3c 100644
--- a/addons/mass_mailing_sms/models/mailing_mailing.py
+++ b/addons/mass_mailing_sms/models/mailing_mailing.py
@@ -19,7 +19,7 @@ class Mailing(models.Model):
sms_template_id = fields.Many2one('sms.template', string='SMS Template', ondelete='set null')
sms_has_insufficient_credit = fields.Boolean(
'Insufficient IAP credits', compute='_compute_sms_has_insufficient_credit',
- help='UX Field to propose to buy IAP credits')
+ help='UX Field to propose to buy IAP credits')
# opt_out_link
sms_allow_unsubscribe = fields.Boolean('Include opt-out link', default=True)
@@ -182,7 +182,7 @@ class Mailing(models.Model):
if not res_ids:
raise UserError(_('There is no recipients selected.'))
- composer = self.env['sms.composer'].create(mailing._send_sms_get_composer_values(res_ids))
+ composer = self.env['sms.composer'].with_context(active_id=False).create(mailing._send_sms_get_composer_values(res_ids))
# extra_context = self._get_mass_mailing_context()
# auto-commit except in testing mode