<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record id="view_account_move_template_invoice_form" model="ir.ui.view">
            <field name="name">account.move.template.invoice.form</field>
            <field name="model">account.move</field>
            <field name="inherit_id" ref="account.view_move_form"/>
            <field name="arch" type="xml">

                <!-- Smart button: visible when move_count > 0 -->
                <xpath expr="//div[@name='button_box']" position="inside">
                    <button type="object"
                            name="action_view_moves"
                            class="oe_stat_button"
                            icon="fa-book"
                            invisible="move_count == 0">
                        <field name="move_count" widget="statinfo" string="Проводки"/>
                    </button>
                </xpath>

                <!-- Template selector after invoice_date -->
                <xpath expr="//field[@name='invoice_date']" position="after">
                    <field name="journal_template_id"
                           string="Шаблон типовой операции"
                           options="{'no_create': True}"/>
                </xpath>

            </field>
        </record>
    </data>
</odoo>
