<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">

         <!-- Create a transporter -->

        <record id="res_partner_23" model="res.partner">
            <field name="name">The Poste</field>
            <field name="is_company">1</field>
            <field name="supplier">1</field>
            <field eval="0" name="customer"/>
            <field name="city">Manchester</field>
            <field name="zip">06040</field>
            <field model="res.country" name="country_id" search="[('code','ilike','us')]"/>
            <field name="street">3958 Maxwell Street</field>
        </record>

        <!-- Create a service product -->

        <record id="product_product_delivery" model="product.product">
            <field name="name">Delivery by Poste</field>
            <field name="default_code">Delivery</field>
            <field name="type">service</field>
            <field name="categ_id" ref="product.product_category_3"/>
            <field name="procure_method">make_to_order</field>
            <field name="standard_price">10.0</field>
            <field name="list_price">10.0</field>
            <field name="image">[encoded data, 7552 characters]</field>
        </record>

        <!-- Carrier -->

        <record id="delivery_carrier" model="delivery.carrier">
            <field name="name">The Poste</field>
            <field name="partner_id" ref="res_partner_23"/>
            <field name="product_id" ref="product_product_delivery"/>
        </record>

        <record id="free_delivery_carrier" model="delivery.carrier">
            <field name="name">Free delivery charges</field>
            <field name="normal_price">10</field>
            <field name="free_if_more_than">True</field>
            <field name="amount">1000</field>
            <field name="partner_id" ref="res_partner_23"/>
            <field name="product_id" ref="product_product_delivery"/>
        </record>

        <record id="normal_delivery_carrier" model="delivery.carrier">
            <field name="name">Normal Delivery Charges</field>
            <field name="normal_price">10</field>
            <field name="partner_id" ref="res_partner_23"/>
            <field name="product_id" ref="product_product_delivery"/>
        </record>
        <record id="sale.sale_order_6" model="sale.order">
            <field name="carrier_id" ref="normal_delivery_carrier"/>
        </record>
        <record id="sale.sale_order_2" model="sale.order">
            <field name="carrier_id" ref="free_delivery_carrier"/>
        </record>

        <!-- Carrier Grids -->

        <record id="delivery_grid" model="delivery.grid">
            <field name="name">The Poste - Pricelist</field>
            <field name="carrier_id" ref="delivery_carrier"/>
        </record>
        <!--  delivery charge of product if weight less than and equal 5kg-->
        <record id="delivery_grid_line1" model="delivery.grid.line">
            <field name="name">Weight &lt;= 5kg</field>
            <field name="grid_id" ref="delivery_grid"/>
            <field eval="5" name="max_value"/>
            <field eval="20" name="list_price"/>
            <field eval="10" name="standard_price"/>
        </record>
        <!--  delivery charge of product if weight more than 5kg-->
        <record id="delivery_grid_line2" model="delivery.grid.line">
            <field name="name">Weight &gt; 5kg</field>
            <field name="grid_id" ref="delivery_grid"/>
            <field name="operator">&gt;=</field>
            <field eval="5" name="max_value"/>
            <field eval="50" name="list_price"/>
            <field eval="30" name="standard_price"/>
        </record>

        <!--  free delivery charge if price more than 300-->
        <record id="delivery_grid_line3" model="delivery.grid.line">
            <field name="name">Free if price &gt;= 300</field>
            <field name="grid_id" ref="delivery_grid"/>
            <field eval="300" name="max_value"/>
            <field name="operator">&gt;=</field>
            <field name="type">price</field>
            <field eval="0" name="list_price"/>
            <field eval="0" name="standard_price"/>
        </record>
    </data>
</openerp>
