<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 Tecnativa - Víctor Martínez
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="purchase_order_form" model="ir.ui.view">
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="inside">
                <button
                    name="action_view_stock_landed_cost"
                    type="object"
                    class="oe_stat_button"
                    icon="fa-list-alt"
                    attrs="{'invisible': [('landed_cost_number', '=', 0)]}"
                    groups="stock.group_stock_manager"
                >
                    <field
                        name="landed_cost_number"
                        widget="statinfo"
                        string="Landed Costs"
                    />
                    <field name="landed_cost_ids" invisible="1" />
                </button>
            </xpath>
        </field>
    </record>
</odoo>
