<?xml version="1.0" encoding="utf-8"?>
<odoo>
        <record id="product_template_form_view" model="ir.ui.view">
            <field name="name">product.template.form.inherit.email.template</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//group[@name='email_template_and_project']" position="attributes">
                    <attribute name="string">Automatic Email at Invoice</attribute>
                    <attribute name="invisible">0</attribute>
                </xpath>
                <xpath expr="//group[@name='email_template_and_project']" position="inside">
                    <field name="email_template_id" string="Email Template" help="Send a product-specific email once the invoice is paid"
                        domain="[('model','=','product.template')]"
                        context="{
                            'form_view_ref':'product_email_template.email_template_form_simplified',
                            'default_model': 'product.template',
                            'default_subject': name,
                            'default_name': name,
                        }"/>
                </xpath>
            </field>
        </record>
</odoo>
