[IMP] mass_mailing_sms: add a form view displaying mailing type choice

Currently in mass_mailing_sms form view of mailing is displaying differently
depending on mailing_type field that is hidden. Purpose is to have a single
form view while not allowing people to change the mailing type as they
always come from a context where it is given (mass_mailing -> mail, mass
mailing sms -> sms, same in marketing automation(_sms)).

In this commit we create a new form view based on the existing one (inherit
and primary) with the only change currently being the mailing_type being
displayed.

It will be used in some cases when we want people to contact in mass records
without knowing if it will be mail or sms. For example on event, allowing
to contact attendees and choose either mail or sms, avoiding to define
two buttons and actions on event form view.

Task ID 2074848 (sms on attendees)
Task ID 2075183 (sms on speakers)
PR #37185
This commit is contained in:
Thibault Delavallée
2019-09-20 13:44:09 +00:00
parent 5989322b82
commit 61611c38e7
@@ -130,6 +130,22 @@
</field>
</record>
<record id="mailing_mailing_view_form_mixed" model="ir.ui.view">
<!-- View allowign to display the mailing type and therefore choosing
the way of mailing: not prioritized one, used in some specific cases
like "contacting people" without predefining mail or sms -->
<field name="name">mailing.mailing.view.form.mixed</field>
<field name="model">mailing.mailing</field>
<field name="mode">primary</field>
<field name="priority">30</field>
<field name="inherit_id" ref="mass_mailing_sms.mailing_mailing_view_form_sms"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='mailing_type']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
<record id="mailing_mailing_view_kanban_sms" model="ir.ui.view">
<field name="name">mailing.mailing.view.kanban.inherit.sms</field>
<field name="model">mailing.mailing</field>