summaryrefslogtreecommitdiff
path: root/addons/event_sms/views/event_mail_views.xml
blob: 430eef7dfef43406e34693d83e42452ad3cd22ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0"?>
<odoo><data>
    <record id="event_mail_view_form" model="ir.ui.view">
        <field name="name">event.mail.view.form.inherit.sms</field>
        <field name="model">event.mail</field>
        <field name="inherit_id" ref="event.view_event_mail_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='notification_type']" position="attributes">
                <attribute name="invisible">0</attribute>
            </xpath>
            <xpath expr="//field[@name='template_id']" position="attributes">
                <attribute name="attrs">{'readonly': [('notification_type', '!=', 'mail')], 'required': [('notification_type', '=', 'mail')]}</attribute>
            </xpath>
            <xpath expr="//field[@name='template_id']" position="after">
                <field name="sms_template_id"
                    attrs="{'readonly': [('notification_type', '!=', 'sms')], 'required': [('notification_type', '=', 'sms')]}"
                    context="{'default_model': 'event.registration'}"/>
            </xpath>
        </field>
    </record>

    <record id="event_mail_view_tree" model="ir.ui.view">
        <field name="name">event.mail.view.tree.inherit.sms</field>
        <field name="model">event.mail</field>
        <field name="inherit_id" ref="event.view_event_mail_tree"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='notification_type']" position="attributes">
                <attribute name="invisible">0</attribute>
            </xpath>
            <xpath expr="//field[@name='template_id']" position="attributes">
                <attribute name="attrs">{'readonly': [('notification_type', '!=', 'mail')], 'required': [('notification_type', '=', 'mail')]}</attribute>
            </xpath>
            <xpath expr="//field[@name='template_id']" position="after">
                <field name="sms_template_id"
                    attrs="{'readonly': [('notification_type', '!=', 'sms')], 'required': [('notification_type', '=', 'sms')]}"
                    context="{'default_model': 'event.registration'}"/>
            </xpath>
        </field>
    </record>

</data></odoo>