[FIX] mass_mailing: campaign subject

- Create a mailing campaign
- Create a mailing 1, set the subject to "Test 1"
- Create a mailing 2, set the subject to "Test 2"

The subject of mailing 1 is set to "Test 2".

When checking the code, this behavior seems the one expected. The
`_rec_name` of a mass mailing is the `subject_id`:

https://github.com/odoo/odoo/blob/7ef4ba03c4f8dce42f5a56b64d2374373d13aa8d/addons/mass_mailing/models/mass_mailing.py#L437

Moreover, there is an onchange to set the subject in line with the
subject of the campaign:

https://github.com/odoo/odoo/blob/7ef4ba03c4f8dce42f5a56b64d2374373d13aa8d/addons/mass_mailing/models/mass_mailing.py#L608

However this behavior is not present up to v11, and only appears in v12.
Surprisingly, this is due to an unrelated improvement which adds the
field in the view (in debug mode): 5b0bcaef3e.

Up to v11, the onchange exists, but since the fields are not in the
view, it has no effect. However, in v12 the fields are in the view so
the onchange has an effect.

Since this was the behavior up to v11, and that the behavior is fixed
in f50fbc6d16, we keep it consistent in v12 as
well.

opw-2007764

closes odoo/odoo#34028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-06-11 12:25:49 +00:00
parent 7ef4ba03c4
commit ca57218b61
@@ -645,7 +645,7 @@
groups="mass_mailing.group_mass_mailing_campaign"/>
<field name="campaign_id" invisible="1"
groups="base.group_no_one"/>
<field name="source_id"
<field name="source_id" readonly="1"
string="Source"
required="False"
groups="base.group_no_one"/>