[FIX] mass_mailing_sms : sms on record chatter

- For the sms marketing, by default the sms is now log
on the chatter of the record (like with the sms composer).
But can be disable it with keep arhives unchecked (in debug mode only).

TASK_ID : 2075733
This commit is contained in:
ryv-odoo
2019-09-30 14:28:30 +00:00
parent b002973f0e
commit 100249f172
@@ -12,6 +12,13 @@ _logger = logging.getLogger(__name__)
class Mailing(models.Model):
_inherit = 'mailing.mailing'
@api.model
def default_get(self, fields):
res = super(Mailing, self).default_get(fields)
if fields is not None and 'keep_archives' in fields and res.get('mailing_type') == 'sms':
res['keep_archives'] = True
return res
# mailing options
mailing_type = fields.Selection(selection_add=[('sms', 'SMS')])
# sms options