<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2015-2020 Akretion (http://www.akretion.com/)
  @author Alexis de Lattre <alexis.delattre@akretion.com>
  License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>


<record id="pricelist_item_fullscreen_action" model="ir.actions.act_window">
    <field name="name">Pricelists Items</field>
    <field name="res_model">product.pricelist.item</field>
    <field name="view_mode">tree,form</field>
    <field name="domain">[('pricelist_id', '=', active_id)]</field>
    <field name="context">{'product_pricelist_item_main_view': True, 'default_pricelist_id': active_id}</field>
</record>

<record id="product_pricelist_view" model="ir.ui.view">
    <field name="name">usability.product.pricelist.form</field>
    <field name="model">product.pricelist</field>
    <field name="inherit_id" ref="product.product_pricelist_view"/>
    <field name="arch" type="xml">
        <div class="oe_title" position="before">
            <div name="button_box" class="oe_button_box">
                <button name="%(pricelist_item_fullscreen_action)d"
                            class="oe_stat_button"
                            icon="fa-building-o"
                            type="action"
                            help="List view of pricelist items">
                    <div class="o_form_field o_stat_info">
                        <span class="o_stat_text">Lines Fullscreen</span>
                    </div>
                </button>
            </div>
        </div>
        <field name="item_ids" position="attributes">
            <attribute name="context">{'from_product_pricelist_view': True, 'default_base': 'list_price'}</attribute>
        </field>

    </field>
</record>


</odoo>
