<?xml version="1.0" ?>
<openerp>
    <data>
    
        <!--        
            Process
        -->
    
        <record id="process_process_salesprocess0" model="process.process">
            <field eval="1" name="active"/>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field eval="&quot;&quot;&quot;Sales Process&quot;&quot;&quot;" name="name"/>
        </record>
        
        <!--        
            Process Node 
        -->
        
        <record id="process_node_order0" model="process.node">
            <field name="menu_id" ref="sale.menu_sale_order"/>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;After confirming order, Create the invoice.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="account.process_process_invoiceprocess0"/>
            <field name="subflow_id" ref="process_process_salesprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="1" name="flow_start"/>
        </record>
        
        <record id="process_node_saleorderprocurement0" model="process.node">
            <field name="menu_id" ref="sale.menu_sale_order"/>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Sale Order Procurement&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Procurement for each line&quot;&quot;&quot;" name="note"/>
            <field name="subflow_id" ref="process_process_salesprocess0"/>
            <field name="process_id" ref="mrp.process_process_procurementprocess0"/>
            <field eval="&quot;&quot;&quot;object.state in ('draft', 'waiting_date', 'manual', 'progress', 'shipping_except', 'invoice_except', 'done', 'cancel')&quot;&quot;&quot;" name="model_states"/>
            <field eval="1" name="flow_start"/>
        </record>
    
        <record id="process_node_quotation0" model="process.node">
            <field name="menu_id" ref="sale.menu_action_order_tree10"/>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Quotation&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Quotation (A sale order in draft state)&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>

        <record id="process_node_saleorder0" model="process.node">
            <field name="menu_id" ref="sale.menu_action_order_tree9"/>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Sale Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Manages the delivery and invoicing progress&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='manual'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>
        
        <record id="process_node_saleprocurement0" model="process.node">
            <field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
            <field name="model_id" ref="mrp.model_mrp_procurement"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Procurement&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;One procurement for each product.&quot;&quot;&quot;" name="note"/>
            <field name="subflow_id" ref="mrp.process_process_procurementprocess0"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='confirmed'&quot;&quot;&quot;" name="model_states"/>
            <field eval="1" name="flow_start"/>
        </record>

        <record id="process_node_packinglist0" model="process.node">
            <field name="menu_id" ref="stock.menu_picking_waiting"/>
            <field name="model_id" ref="stock.model_stock_picking"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Outgoing Products&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Packing OUT is created for stockable products.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field eval="&quot;&quot;&quot;object.state in ('assigned', 'confirmed')&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>

        <record id="process_node_deliveryorder0" model="process.node">
            <field name="menu_id" ref="stock.menu_picking_waiting_delivery"/>
            <field name="model_id" ref="stock.model_stock_picking"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Delivery Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Delivery, from the warehouse to the customer.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field eval="&quot;&quot;&quot;object.state in ('done', 'assigned')&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>

        <record id="process_node_invoice0" model="process.node">
            <field name="menu_id" ref="account.menu_invoice_draft"/>
            <field name="model_id" ref="account.model_account_invoice"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Draft Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Draft customer invoice, to be reviewed by accountant.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field name="subflow_id" ref="account.process_process_invoiceprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>

        <record id="process_node_invoiceafterdelivery0" model="process.node">
            <field name="menu_id" ref="account.menu_invoice_draft"/>
            <field name="model_id" ref="account.model_account_invoice"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Draft Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Invoice based on packing lists&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_salesprocess0"/>
            <field name="subflow_id" ref="account.process_process_invoiceprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>
        
        <!--        
            Process Condition
        -->

        <record id="process_condition_conditionafterdelivery0" model="process.condition">
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="node_id" ref="process_node_invoiceafterdelivery0"/>
            <field eval="&quot;&quot;&quot;object.order_policy=='postpaid'&quot;&quot;&quot;" name="model_states"/>
            <field eval="&quot;&quot;&quot;condition_after_delivery&quot;&quot;&quot;" name="name"/>
        </record>
        
        <!--        
            Process Transition
        -->
        
        <record id="res_roles_salesman0" model="res.roles">
            <field eval="&quot;&quot;&quot;Salesman&quot;&quot;&quot;" name="name"/>
        </record>
    
        <record id="sale.trans_draft_router" model="workflow.transition">
            <field name="role_id" ref="res_roles_salesman0"/>
        </record>
    
    	<record id="sale.trans_wait_invoice_invoice_manual" model="workflow.transition">
            <field name="role_id" ref="res_roles_salesman0"/>
        </record>
    
        <record id="process_transition_confirmquotation0" model="process.transition">
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Confirm Quotation&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Whenever confirm button is clicked, the draft state is moved to manual. that is, quotation is moved to  sale order.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_saleorder0"/>
            <field model="process.node" name="source_node_id" ref="process_node_quotation0"/>
            <field eval="[(6,0,[ref('sale.trans_draft_router')])]" name="transition_ids"/>
        </record>
        
        <record id="process_transition_saleprocurement0" model="process.transition">
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Sale Procurement&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Procurement is created after confirmation of sale order.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_saleprocurement0"/>
            <field model="process.node" name="source_node_id" ref="process_node_saleorder0"/>
        </record>

        <record id="process_transition_packing0" model="process.transition">
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Packing&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Packing list is created when 'Assign' is being clicked after confirming the sale order. This transaction moves the sale order to packing list.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_packinglist0"/>
            <field model="process.node" name="source_node_id" ref="process_node_saleprocurement0"/>
        </record>
        
        <record id="process_transition_deliver0" model="process.transition">
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Deliver&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Confirming the packing list moves them to delivery order. This can be done by clicking on 'Validate' button.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_deliveryorder0"/>
            <field model="process.node" name="source_node_id" ref="process_node_packinglist0"/>
        </record>

        <record id="process_transition_invoice0" model="process.transition">
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Invoice is created when 'Create Invoice' is being clicked after confirming the sale order. This transaction moves the sale order to invoices.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_invoice0"/>
            <field model="process.node" name="source_node_id" ref="process_node_saleorder0"/>
            <field eval="[(6,0,[ref('sale.trans_wait_invoice_invoice_manual')])]" name="transition_ids"/>
        </record>

        <record id="process_transition_invoiceafterdelivery0" model="process.transition">
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Invoice after delivery&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;When you select Shipping Ploicy = 'Automatic Invoice after delivery' , it will automatic create after delivery.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_invoiceafterdelivery0"/>
            <field model="process.node" name="source_node_id" ref="process_node_packinglist0"/>
        </record>
    
        <record id="process_transition_saleorderprocurement0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Sale Procurement&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;In sale order , procuerement for each line and it comes into the procurement order&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="mrp.process_node_procureproducts0"/>
            <field model="process.node" name="source_node_id" ref="process_node_saleorderprocurement0"/>
        </record>
        
        <record id="process_transition_saleinvoice0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Sale Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Confirm sale order and Create invoice.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="account.process_node_draftinvoices0"/>
            <field model="process.node" name="source_node_id" ref="process_node_order0"/>
        </record>
        
        <!--        
            Process Action
        -->
        
        <record id="process_transition_action_confirm0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_wait&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Confirm&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_confirmquotation0"/>
        </record>

        <record id="process_transition_action_cancel0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_cancel&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Cancel&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_confirmquotation0"/>
        </record>
        
        <record id="process_transition_action_assign0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_assign&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Assign&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_packing0"/>
        </record>

        <record id="process_transition_action_forceassignation0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;force_assign&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Force Assignation&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_packing0"/>
        </record>

        <record id="process_transition_action_cancel1" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_cancel&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Cancel&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_packing0"/>
        </record>
        
        <record id="process_transition_action_cancelassignation0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;cancel_assign&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Cancel Assignation&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_deliver0"/>
        </record>

        <record id="process_transition_action_validate0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;test_finnished&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Validate&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_deliver0"/>
        </record>

        <record id="process_transition_action_cancel2" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_cancel&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Cancel&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_deliver0"/>
        </record>
        
        <record id="process_transition_action_createinvoice0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_invoice_create&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Create Invoice&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_invoice0"/>
        </record>
    
    	<record id="process_transition_action_cancelorder0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;action_cancel&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Cancel Order&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_invoice0"/>
        </record>
    
    </data>
</openerp>
