<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        <!-- Delivery Carriers -->
        <menuitem id="menu_delivery" name="Delivery" parent="stock.menu_stock_configuration" sequence="4"/>
        
        <record id="view_delivery_carrier_tree" model="ir.ui.view">
            <field name="name">delivery.carrier.tree</field>
            <field name="model">delivery.carrier</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Carrier">
                    <field name="name"/>
                    <field name="partner_id"/>
                </tree>
            </field>
        </record>
        <record id="view_delivery_carrier_form" model="ir.ui.view">
            <field name="name">delivery.carrier.form</field>
            <field name="model">delivery.carrier</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Carrier">
                    <field name="name" select="1"/>
                    <field name="active" select="1"/>
                    <field name="partner_id" select="1"/>
                    <field name="product_id" select="1"/>
                </form>
            </field>
        </record>
        <record id="action_delivery_carrier_form" model="ir.actions.act_window">
            <field name="name">Delivery Method</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">delivery.carrier</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem action="action_delivery_carrier_form" id="menu_action_delivery_carrier_form" parent="menu_delivery"/>
        
        <!-- Delivery Grids -->
        <record id="view_delivery_grid_tree" model="ir.ui.view">
            <field name="name">delivery.grid.tree</field>
            <field name="model">delivery.grid</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Delivery grids">
                    <field name="sequence"/>
                    <field name="carrier_id"/>
                    <field name="name"/>
                </tree>
            </field>
        </record>
        
        <record id="view_delivery_grid_form" model="ir.ui.view">
            <field name="name">delivery.grid.form</field>
            <field name="model">delivery.grid</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Delivery grids">
                    <notebook>
                        <page string="Grid definition">
                            <field name="name" select="1"/>
                            <field name="active" select="1"/>
                            <field name="carrier_id" select="1"/>
                            <field name="sequence" select="1"/>
                            <separator colspan="4" string="Grid Lines"/>
                            <field colspan="4" name="line_ids" nolabel="1" select="1"/>
                        </page>
                        <page string="Destination">
                            <field colspan="4" name="country_ids"/>
                            <field colspan="4" name="state_ids"/>
                            <field name="zip_from"/>
                            <field name="zip_to"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="action_delivery_grid_form" model="ir.actions.act_window">
            <field name="name">Delivery Pricelist</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">delivery.grid</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem action="action_delivery_grid_form" id="menu_action_delivery_grid_form" parent="menu_delivery"/>
        
        <record id="view_delivery_grid_line_form" model="ir.ui.view">
            <field name="name">delivery.grid.line.form</field>
            <field name="model">delivery.grid.line</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Grid Lines">
                    <field colspan="4" name="name" select="1"/>
                    <field name="type" string="Condition"/>
                    <field name="operator" nolabel="1"/>
                    <field name="max_value" nolabel="1"/>
                    <field name="list_price"/>
                    <field name="standard_price"/>
                    <field name="price_type"/>
                    <field name="variable_factor"/>
                </form>
            </field>
        </record>
        <record id="view_delivery_grid_line_tree" model="ir.ui.view">
            <field name="name">delivery.grid.line.tree</field>
            <field name="model">delivery.grid.line</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Grid Lines">
                    <field name="name"/>
                    <field name="type"/>
                    <field name="operator"/>
                    <field name="max_value"/>
                    <field name="list_price"/>
                    <field name="standard_price"/>
                </tree>
            </field>
        </record>
        
        <record id="view_order_withcarrier_form" model="ir.ui.view">
            <field name="name">delivery.sale.order_withcarrier.form.view</field>
            <field name="type">form</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                <field name="client_order_ref" position="after">
                    <field name="carrier_id"/>
                     
                </field>
            </field>
        </record>
        
        <record id="view_picking_withcarrier_form" model="ir.ui.view">
            <field name="name">delivery.stock.picking_withcarrier.form.view</field>
            <field name="type">form</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_delivery_form"/>
            <field name="arch" type="xml">
                <field name="address_id" position="after">
                    <field name="volume"/>
                    <field name="weight"/>
                    <field name="carrier_id"/>
                </field>
            </field>
        </record>
        <record id="view_picking_withcarrier_out_form" model="ir.ui.view">
            <field name="name">delivery.stock.picking_withcarrier.out.form.view</field>
            <field name="type">form</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_out_form"/>
            <field name="arch" type="xml">
                <field name="address_id" position="after">
                    <field name="volume"/>
                    <field name="weight"/>
                    <field name="carrier_id"/>
                </field>
            </field>
        </record>
        
        <record id="view_picking_withcarrier_delivery_form" model="ir.ui.view">
            <field name="name">delivery.stock.picking_withcarrier.delivery.form.view</field>
            <field name="type">form</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_delivery_form"/>
            <field name="arch" type="xml">
                <field name="address_id" position="after">
                    <field name="volume"/>
                    <field name="weight"/>
                    <field name="carrier_id"/>
                </field>
            </field>
        </record>
        
        <record id="action_picking_tree4" model="ir.actions.act_window">
            <field name="name">Packings to be invoiced</field>
            <field name="res_model">stock.picking</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('invoice_state','=','2binvoiced'),('state','=','done'),('type','=','out')]</field>
        </record>
        <menuitem action="action_picking_tree4" id="menu_action_picking_tree3" parent="stock.menu_action_picking_tree"/>
        
        
        <record id="action_picking_tree5" model="ir.actions.act_window">
            <field name="name">Generate Draft Invoices On Receptions</field>
            <field name="res_model">stock.picking</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('invoice_state','=','2binvoiced'),('state','=','done'),('type','=','in')]</field>
        </record>
        <menuitem action="action_picking_tree5" id="menu_action_picking_tree5" parent="stock.menu_action_picking_tree4"/>
        
        
    </data>
</terp>