summaryrefslogtreecommitdiff
path: root/addons/event_sms/views/event_views.xml
blob: fb49147c973ac98a2a20006c7b4267c66254e2a2 (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
42
<?xml version="1.0"?>
<odoo><data>

    <record id="event_type_view_form" model="ir.ui.view">
        <field name="name">event.type.view.form.inherit.sms</field>
        <field name="model">event.type</field>
        <field name="inherit_id" ref="event.view_event_type_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_event_view_form_inherit_sms" model="ir.ui.view">
        <field name="name">event.event.view.form</field>
        <field name="model">event.event</field>
        <field name="inherit_id" ref="event.view_event_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>

</data></odoo>