<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 ACSONE SA/NV
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>

    <record model="ir.ui.view" id="email_template_form">
        <field name="name">mail.template.form (in mail_template_substitute)
        </field>
        <field name="model">mail.template</field>
        <field name="inherit_id" ref="mail.email_template_form" />
        <field name="arch" type="xml">
            <xpath expr="//notebook" position="inside">
                <page
                    name="mail_template_substitution_rule"
                    string="Substitution Rules"
                >
                    <field name="mail_template_substitution_rule_ids">
                        <tree>
                            <field name="sequence" widget="handle" />
                            <field name="substitution_mail_template_id" />
                            <field name="domain" />
                        </tree>
                        <form>
                            <sheet>
                                <group>
                                    <field
                                        name="mail_template_id"
                                        invisible="1"
                                        readonly="1"
                                        required="0"
                                    />
                                    <field name="model" invisible="1" />
                                    <field
                                        name="substitution_mail_template_id"
                                        domain="[('model', '=', model), ('id', '!=', parent.id)]"
                                    />
                                </group>
                                <group>
                                    <field
                                        name="domain"
                                        widget="domain"
                                        options="{'model': 'model'}"
                                    />
                                </group>
                            </sheet>
                        </form>
                    </field>
                </page>
            </xpath>
        </field>
    </record>


</odoo>
