Skip to content

Commit 106840c

Browse files
danimaribeiromart-e
authored andcommitted
[FIX] mass_mailing: allow to quick create a mass_mailing
_rec_name in mass mailing is source_id which is an integer, it does not accept a char value. Instead specify the `name` value, which will create a utm.source. Closes odoo#13765
1 parent 649823b commit 106840c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

addons/mass_mailing/models/mass_mailing.py

+6
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,12 @@ def _onchange_model_and_list(self):
424424
# Technical stuff
425425
#------------------------------------------------------
426426

427+
@api.model
428+
def name_create(self, name):
429+
""" _rec_name is source_id, creates a utm.source instead """
430+
mass_mailing = self.create({'name': name})
431+
return mass_mailing.name_get()[0]
432+
427433
@api.multi
428434
def copy(self, default=None):
429435
self.ensure_one()

0 commit comments

Comments
 (0)