<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <!-- Copyright 2013-2014 Alexis de Lattre <alexis.delattre@akretion.com>
         License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
    <record id="invoice_form" model="ir.ui.view">
        <field name="name">related.pickings.account.invoice.form</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_move_form" />
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <field name="picking_ids" invisible="1" />
                <button
                    type="object"
                    name="action_show_picking"
                    class="oe_stat_button"
                    icon="fa-truck"
                    attrs="{'invisible': [('picking_count', '=', 0)]}"
                >
                    <field name="picking_count" widget="statinfo" string="Delivery" />
                </button>
            </div>
            <xpath expr="//field[@name='invoice_line_ids']//tree" position="inside">
                <field name="move_line_ids" force_save="1" invisible="1" />
            </xpath>
            <xpath expr="//field[@name='line_ids']//tree" position="inside">
                <field name="move_line_ids" force_save="1" invisible="1" />
            </xpath>
        </field>
    </record>
</odoo>
