<?xml version='1.0' encoding='utf-8'?>
<odoo>
    <record id="account_tag_action" model="ir.actions.act_window">
        <field name="name">Account Tags</field>
        <field name="res_model">account.account.tag</field>
        <field name="search_view_id" ref="account.account_tag_view_search"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Add a new tag
            </p>
        </field>
    </record>

    <record id="action_account_group_tree" model="ir.actions.act_window">
        <field name="name">Account Groups</field>
        <field name="res_model">account.group</field>
        <field name="view_mode">list,form</field>
        <field name="search_view_id" ref="account.view_account_group_search"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create a new account group
            </p>
        </field>
    </record>

    <record id="view_account_form" model="ir.ui.view">
        <field name="name">account.account.form</field>
        <field name="model">account.account</field>
        <field name="inherit_id" ref="account.view_account_form"/>
        <field name="arch" type="xml">
            <field name="currency_id" position="after">
                <label for="reconcile"
                       invisible="account_type in ('asset_cash', 'liability_credit_card', 'off_balance')"/>
                <div invisible="account_type in ('asset_cash', 'liability_credit_card', 'off_balance')">
                    <field name="reconcile"/>
                    <button name="action_open_reconcile" class="oe_link" type="object" string=" -> Reconcile"
                            invisible="not reconcile"/>
                </div>
            </field>
        </field>
    </record>
    <record id="view_account_form" model="ir.ui.view">
        <field name="name">account.account.reports.form</field>
        <field name="model">account.account</field>
        <field name="inherit_id" ref="account.view_account_form"/>
        <field name="arch" type="xml">
            <field name="currency_id" position="before">
                <field name="non_trade" invisible="account_type not in ('liability_payable', 'asset_receivable')"/>
            </field>
        </field>
    </record>
    <!--    -&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;-->
<!--    <record id="view_move_line_tree" model="ir.ui.view">-->
<!--        <field name="name">account.move.line.list</field>-->
<!--        <field name="model">account.move.line</field>-->
<!--        <field name="inherit_id" ref="fusion_accounting.view_move_line_tree"/>-->
<!--        <field name="mode">extension</field>-->
<!--        <field name="arch" type="xml">-->
<!--            <xpath expr="//header" position="inside">-->
<!--                <button name="turn_as_asset" type="object" string="Create Asset" groups="account.group_account_user"-->
<!--                        data-hotkey="c"/>-->
<!--            </xpath>-->
<!--        </field>-->
<!--    </record>-->

    <record id="view_account_form_asset_inherit" model="ir.ui.view">
        <field name="name">account.account.form</field>
        <field name="model">account.account</field>
        <field name="inherit_id" ref="account.view_account_form"/>
        <field name="arch" type="xml">
            <xpath expr="//page[@name='accounting']" position="after">
                <page string="Automation" name="page_automation" invisible="not can_create_asset">
                    <group>
                        <group>
                            <field name="can_create_asset" invisible="1"/>
                            <field name="form_view_ref" invisible="1"/>
                            <td class="o_td_label">
                                <label for="create_asset" string="Automate Asset"/>
                            </td>
                            <field name="create_asset" invisible="not can_create_asset" nolabel="1" widget="radio"/>
                            <field name="multiple_assets_per_line" string="Manage Items"
                                   invisible="not can_create_asset or create_asset == 'no'"/>
                            <field name="asset_model_ids"
                                   widget="many2many_tags"
                                   domain="[('state', '=', 'model')]"
                                   invisible="context.get('hide_model_on_account') or (create_asset == 'no' or not can_create_asset)"
                                   required="create_asset == 'validate' and can_create_asset"
                                   context="{
                                        'default_state': 'model',
                                        'form_view_ref': form_view_ref,
                                        'default_account_depreciation_id': id,
                                   }"
                                   string="Asset Model"
                                   options="{'no_quick_create': True}"
                            />
                        </group>
                    </group>
                </page>
            </xpath>
        </field>
    </record>

</odoo>
