<odoo>
  <data>

    <record model="ir.actions.server" id="action_res_partner_liquidacion_buy">
        <field name="name">Liquidación Depósito Compras</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="base.model_res_partner" />
        <field name="state">code</field>
        <field name="code">action =record.make_liquidation_buy()</field>
    </record>

    <record model="ir.actions.server" id="action_res_partner_liquidacion_sale">
        <field name="name">Liquidación Depósito Ventas</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="base.model_res_partner" />
        <field name="state">code</field>
        <field name="code">action =record.make_liquidation_sale()</field>
    </record>

    <record id="view_partner_form" model="ir.ui.view">
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="priority">200</field>
        <field name="arch" type="xml">
            <page name="internal_notes" position="after">
              <page name="depositos" string="Depósitos">
                <div clas="o_horizontal_separator"><h2>Depósitos</h2></div>
                <group class="o_group o_inner_group o_group_col_6">
                    <group>
                    <field name="deposit_sale_accept"/>
                    </group>
                    <group attrs="{'invisible': [('deposit_sale_accept', '!=', True)]}"> 
                    <field name="deposit_sale_location_id"  readonly="1" />
                    <field name="deposit_sale_last_liquidation_date" readonly="1" />
<!--                    <button string="Current Stock"
                            class="oe_stat_button"
                            icon="fa-building-o" 
                            name="%(stock.location_open_quants)d"
                            type="action"
                            context="{'active_id': deposit_sale_location_id}"
                            groups="stock.group_stock_manager"
                    /> -->
                    </group>
                </group>
                <group class="o_group o_inner_group o_group_col_6">
                    <group>
                    <field name="deposit_buy_accept"/>
                    </group> 
                    <group attrs="{'invisible': [('deposit_buy_accept', '!=', True)]}"> 
                    <field name="deposit_buy_location_id" readonly="1" />
                    <field name="deposit_buy_last_liquidation_date" readonly="1" />
<!--                    <button string="Current Stock"
                            class="oe_stat_button"
                            icon="fa-building-o" 
                            name="%(stock.location_open_quants)d"
                            type="action"
                            context="{'active_id': deposit_buy_location_id}"
                            groups="stock.group_stock_manager"
                    /> -->
                    </group>  
                </group>
              </page>
            </page>
            <div name="button_box" position="inside">
                <button name="%(stock_picking_deposito.action_res_partner_liquidacion_buy)d"
                        string="Liquida Compras"
                        type="action"
                        class="oe_stat_button"
                        icon="fa-calendar"
                        help="Realiza el informe de liquidación para éste proveedor."
                        groups="stock.group_stock_manager"
                        attrs="{'invisible': [('deposit_buy_accept', '!=', True)]}"
                />
                <button name="%(stock_picking_deposito.action_res_partner_liquidacion_sale)d"
                        string="Liquida Ventas"
                        type="action"
                        class="oe_stat_button"
                        icon="fa-calendar"
                        help="Liquida el depósito de ventas."
                        groups="stock.group_stock_manager"
                        attrs="{'invisible': [('deposit_sale_accept', '!=', True)]}"
                />
            </div>
        </field>
    </record>

  </data>
</odoo>
