<odoo>
    <record id="view_move_importer_form" model="ir.ui.view">
        <field name="name">account.move.view</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_move_form"/>
        <field name="arch" type="xml">
            <field name="journal_id" position="after">
                <field name="used_for_completion" invisible="1"/>
            </field>
            <button name="button_cancel" position="after">
                <button name="button_auto_completion"
                        string="Auto Completion"
                        type="object"
                        class="oe_highlight"
                        groups="account.group_account_invoice"
                        attrs="{'invisible': ['|', ('used_for_completion','=',False), ('state','not in', ['draft'])]}"/>
            </button>
            <xpath expr="//field[@name='line_ids']/tree/field[@name='credit']" position="after">
                <field name="already_completed"/>
            </xpath>
            <xpath expr="/form/sheet/notebook" position="inside">
                <page string="Completion Logs" attrs="{'invisible':[('completion_logs','=',False)]}">
                    <field name="completion_logs" colspan="4" nolabel="1"/>
                </page>
            </xpath>
        </field>
    </record>

    <record id="move_completion_rule_view_form" model="ir.ui.view">
        <field name="name">account.move.completion.rule.view</field>
        <field name="model">account.move.completion.rule</field>
        <field name="arch" type="xml">
            <form string="Move Completion Rule">
                <group>
                    <field name="sequence"/>
                    <field name="name" select="1" />
                    <field name="function_to_call"/>
                </group>
                <separator colspan="4" string="Related Profiles"/>
                <field name="journal_ids" nolabel="1" colspan="4"/>
            </form>
        </field>
    </record>

    <record id="move_completion_rule_view_tree" model="ir.ui.view">
        <field name="name">account.move.completion.rule.view</field>
        <field name="model">account.move.completion.rule</field>
        <field name="arch" type="xml">
            <tree string="Move Completion Rule">
                <field name="sequence"/>
                <field name="name" select="1" />
                <field name="journal_ids" />
                <field name="function_to_call"/>
            </tree>
        </field>
    </record>

    <record id="action_move_completion_rule_tree" model="ir.actions.act_window">
        <field name="name">Move Completion Rule</field>
        <field name="res_model">account.move.completion.rule</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem string="Move Completion Rule" action="action_move_completion_rule_tree"
              id="menu_action_move_completion_rule_tree_menu" parent="account.account_management_menu"/>
</odoo>
