<?xml version="1.0"?>
<openerp>
    <data noupdate="1">
        <!--Transfer of Products in the Picking of Purchase Order -->

        <record id="transfer_purchase_wizard_rma" model="stock.transfer_details">
            <field name="picking_id" model="stock.picking" search="[('origin', '=', 'POWIZARDCLAIM001')]"/>
            <field name="picking_source_location_id" ref="stock.stock_location_suppliers"/>
            <field name="picking_destination_location_id" ref="stock.stock_location_stock"/>
        </record>


        <!-- Transfer Detail Items of Product Transfer -->

        <record id="transfer_purchase_wizard_rma_item_1" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_1"/>
        </record>

        <record id="transfer_purchase_wizard_rma_item_2" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_2"/>
        </record>

        <record id="transfer_purchase_wizard_rma_item_3" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_3"/>
        </record>

        <record id="transfer_purchase_wizard_rma_item_4" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_4"/>
        </record>

        <record id="transfer_purchase_wizard_rma_item_5" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_6"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_5"/>
        </record>

        <!-- two MAC without lot -->
        <record id="transfer_purchase_wizard_rma_item_6" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">2</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
        </record>


        <record id="transfer_purchase_wizard_rma_item_7" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_39"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
        </record>


        <record id="transfer_purchase_wizard_rma_item_8" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_39"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
        </record>


        <record id="transfer_purchase_wizard_rma_item_9" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_purchase_wizard_rma"/>
            <field name="product_id" ref="product.product_product_38"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id" ref="stock.stock_location_suppliers"/>
            <field name="destinationloc_id"  ref="stock.stock_location_stock"/>
        </record>

        <!-- Make transfer of product -->

        <function model="stock.transfer_details"
            name="do_detailed_transfer" eval="[ref('transfer_purchase_wizard_rma')]"/>



        <!-- Transfer of Products in the Picking of Purchase Order 2 -->

        <record id="transfer_sale_wizard_rma" model="stock.transfer_details">
            <field name="picking_id" model="stock.picking" search="[('origin', '=', 'SOWIZARDCLAIM001')]"/>
            <field name="picking_source_location_id" ref="stock.stock_location_stock"/>
            <field name="picking_destination_location_id" ref="stock.stock_location_customers"/>
        </record>

        <!-- Transfer Detail Items Part 2 of Product Transfer -->

        <record id="transfer_sale_wizard_rma_item_1" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_38"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
        </record>

        <record id="transfer_sale_wizard_rma_item_2" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_39"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">2</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
        </record>

        <record id="transfer_sale_wizard_rma_item_3" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_6"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_5"/>
        </record>

        <record id="transfer_sale_wizard_rma_item_4" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_1"/>
        </record>

        <record id="transfer_sale_wizard_rma_item_5" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_2"/>
        </record>

        <record id="transfer_sale_wizard_rma_item_6" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_3"/>
        </record>

        <record id="transfer_sale_wizard_rma_item_7" model="stock.transfer_details_items">
            <field name="transfer_id" ref="transfer_sale_wizard_rma"/>
            <field name="product_id" ref="product.product_product_8"/>
            <field name="product_uom_id" ref="product.product_uom_unit"/>
            <field name="quantity">1</field>
            <field name="sourceloc_id"  ref="stock.stock_location_stock"/>
            <field name="destinationloc_id" ref="stock.stock_location_customers"/>
            <field name="lot_id" ref="lot_purchase_wizard_rma_item_4"/>
        </record>

        <!-- Make transfer of product -->
        <function model="stock.picking" name="action_assign">
            <value eval="obj(ref('so_wizard_rma_1')).picking_ids[0].id" model="sale.order"/>
        </function>

        <function model="stock.transfer_details"
            name="do_detailed_transfer" eval="[ref('transfer_sale_wizard_rma')]"/>

    </data>
</openerp>
