<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record model="ir.ui.view" id="asset_pause_tree">
        <field name="name">asset.pause.tree</field>
        <field name="model">asset.pause</field>
        <field name="arch" type="xml">
            <tree string="Modify Asset">
                <field name="asset_id"/>
                <field name="date"/>
                <field name="state"/>
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="asset_pause_form">
        <field name="name">asset.pause.form</field>
        <field name="model">asset.pause</field>
        <field name="arch" type="xml">
            <form string="Pause Asset">
                <header>
                    <button groups='exp_asset_base.group_assets_manager' name="act_confirm"  invisible="state != 'draft'"  string="Confirm" type="object" class="oe_highlight"/>
                    <button groups="exp_asset_base.group_assets_manager" name="act_approve"  invisible="state != 'confirm'"   string="Approve" type="object" class="oe_highlight"/>
                    <button groups="exp_asset_base.group_assets_manager" name="do_action"  invisible="state != 'approve'"   string="Done" type="object" class="oe_highlight"/>
                    <button groups="exp_asset_base.group_assets_manager" name="act_draft"  invisible="state not in ['confirm','approve']"  string="Set to Draft" type="object"/>
                    <field  name="state" widget="statusbar" statusbar_visible="draft,confirm,approve,done"/>
                </header>
                <sheet>
                    <group>
                        <group>
                            <field name="asset_id" required="1"  readonly="state != 'draft'" context="{'form_view_ref': 'odex30_account_asset.view_account_asset_form'}"/>
                            <field name="date" required="1" readonly="state != 'draft'"/>
                        </group>
                    </group>
                </sheet>
                <chatter/>
            </form>
        </field>
    </record>

    <record id="action_asset_pause" model="ir.actions.act_window">
        <field name="name">Asset Pause</field>
        <field name="res_model">asset.pause</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem id="asset_pause_menu"
                  parent="menu_account_asset_operation"
                  action="action_asset_pause"
                  name="Assets Pause" sequence="2"/>

</odoo>
