<?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&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;Sale Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Confirmed sale order to 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 Requisition&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Drives procurement orders for every sale order line.&quot;&quot;&quot;" name="note"/>
            <field name="subflow_id" ref="process_process_salesprocess0"/>
            <field name="process_id" ref="procurement.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_sale_order"/>
            <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;Draft state of sale order&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_sale_order"/>
            <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;Drives procurement and invoicing&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="base.menu_mrp_procurement_action"/>
            <field name="model_id" ref="procurement.model_procurement_order"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Procurement Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;One Procurement order for each sale order line and for each of the components.&quot;&quot;&quot;" name="note"/>
            <field name="subflow_id" ref="procurement.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="model_id" ref="stock.model_stock_picking"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Pick List&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Document of the move to the output or to the customer.&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_action_picking_tree_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;Document of the move 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_action_invoice_tree1"/>
            <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;Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;To be reviewed by the 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_action_invoice_tree1"/>
            <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;Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Based on the shipped or on the ordered quantities.&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;The salesman confirms the quotation. The state of the sale order becomes 'In progress' or 'Manual in progress'.&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;Create Procurement Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;A procurement order is automatically created as soon as a sale order is confirmed or as the invoice is paid. It drives the purchasing and the production of products regarding to the rules and to the sale order's parameters. &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;Create Pick List&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The Pick List form is created as soon as the sale order is confirmed, in the same time as the procurement order. It represents the assignment of parts to the sale order. There is 1 pick list by sale order line which evolves with the availability of parts.&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;Create Delivery Order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Depending on the configuration of the location Output, the move between the output area and the customer is done through the Delivery Order manually or automatically.&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;Create Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The Salesman creates an invoice manually, if the sales order shipping policy is 'Shipping and Manual in Progress'. The invoice is created automatically if the shipping policy is 'Payment before Delivery'.&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;Create Invoice&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The invoice is created automatically if the shipping policy is 'Invoice from pick' or 'Invoice on order 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;Procurement of sold material&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;For every sale order line, a procurement order is created to supply the sold product.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="procurement.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;From a sale order&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;A sale order generates an invoice, as soon as it is confirmed by the salesman. Depending on the Invoicing control of the sale order, the invoice is based on delivered or on ordered quantities.&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>
