Files
odoo_source/addons/mass_mailing/wizard/mail_compose_message_views.xml
T
Gorash 1e12f68a1d [REF] base,all: Update modifier syntax: prepare view migration
These changes are made as a result of simplifying attrs and 'states' in
views.

Before applying the migration script, it is necessary to fix some views.
These views are erroneous and either work by chance or are simply
untested. We have for example wrong domains, elements used by modifiers
but not present in the view, obsolete domain operators, inherit views
not targeting the right views, xpaths using attributes as target, the
use of %(...)s in views, false attribute value types in python.

Part-of: odoo/odoo#104741
2023-08-18 09:49:12 +02:00

48 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Add mass mail campaign to the mail.compose.message form view -->
<record model="ir.ui.view" id="email_compose_form_mass_mailing">
<field name="name">mail.compose.message.form.mass_mailing</field>
<field name="model">mail.compose.message</field>
<field name="inherit_id" ref="mail.email_compose_message_wizard_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='auto_delete_keep_log']" position="after">
<field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"
attrs="{'invisible': ['|', ('composition_mode', '!=', 'mass_mail'), ('model_is_thread', '!=', True)]}"/>
<field name="mass_mailing_name"
attrs="{'invisible': ['|', ('composition_mode', '!=', 'mass_mail'), ('model_is_thread', '!=', True)]}"/>
</xpath>
<xpath expr="//button[@name='action_send_mail'][not(hasclass('o_mail_send'))]" position="attributes">
<!-- 'Log' button -->
<attribute name="attrs">
{'invisible': [
'|',
('subtype_is_log', '=', False),
'&amp;',
('mass_mailing_name', '!=', ''),
('mass_mailing_name', '!=', False)
]}
</attribute>
</xpath>
<xpath expr="//button[hasclass('o_mail_send')]" position="attributes">
<!-- 'Send' button -->
<attribute name="attrs">
{'invisible': [
'|',
('subtype_is_log', '=', True),
'&amp;',
('mass_mailing_name', '!=', ''),
('mass_mailing_name', '!=', False)
]}
</attribute>
</xpath>
<xpath expr="//button[@name='action_send_mail']" position="after">
<button string="Send Mass Mailing" name="action_send_mail" type="object" class="btn-primary o_mail_send"
attrs="{'invisible': ['|', ('mass_mailing_name', '=', ''), ('mass_mailing_name', '=', False)]}" data-hotkey="q"/>
</xpath>
</field>
</record>
</odoo>