~unifield-team/unifield-wm/us-826

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
    <data>
    
        <record id="act_sale_loan" model="workflow.activity">
            <field name="wkf_id" ref="sale.wkf_sale"/>
            <field name="name">loan</field>
            <field name="kind">subflow</field>
            <field name="subflow_id" search="[('osv','=','purchase.order')]" type="int"/>
            <field name="action">action_purchase_order_create()</field>
        </record>
        <record id="act_sale_loan_done" model="workflow.activity">
            <field name="wkf_id" ref="sale.wkf_sale" />
            <field name="name">loan_done</field>
        </record>

        <record id="act_sale_order_validated" model="workflow.activity">
            <field name="wkf_id" ref="sale.wkf_sale" />
            <field name="name">order_validated</field>
            <field name="kind">function</field>
            <field name="action">wkf_validated()</field>
        </record>

        <record id="trans_draft_validated" model="workflow.transition">
            <field name="act_from" ref="sale.act_draft" />
            <field name="act_to" ref="act_sale_order_validated" />
            <field name="signal">order_validated</field>
        </record>
        
        <record id="trans_sale_router_loan" model="workflow.transition">
            <field name="act_from" ref="sale.act_router" />
            <field name="act_to" ref="act_sale_loan" />
            <field name="condition">order_type=='loan' and not loan_id</field>
        </record>
        <record id="trans_sale_router_loan_done" model="workflow.transition">
            <field name="act_from" ref="sale.act_router" />
            <field name="act_to" ref="act_sale_loan_done" />
            <field name="condition">order_type!='loan' or loan_id</field>
        </record>
        <record id="trans_sale_loan_done" model="workflow.transition">
            <field name="act_from" ref="act_sale_loan"/>
            <field name="act_to" ref="act_sale_loan_done"/>
            <field name="signal">subflow.done</field>
        </record>
        <record id="trans_sale_loand_done_end" model="workflow.transition">
            <field name="act_from" ref="act_sale_loan_done" />
            <field name="act_to" ref="sale.act_done" />
        </record>
        <record id="sale.trans_router_wait_invoice_shipping" model="workflow.transition">
            <field name="act_from" ref="sale.act_wait_invoice"/>
            <field name="act_to" ref="sale.act_invoice_end"/>
            <field name="condition">(order_policy=='picking') or order_type!='regular' or (order_type=='regular' and partner_id.partner_type=='internal')</field>
        </record>
        
        <!-- SPLIT STEP -->
        
        <record id="act_sale_order_split" model="workflow.activity">
            <field name="wkf_id" ref="sale.wkf_sale" />
            <field name="name">order_split</field>
            <field name="kind">function</field>
            <field name="action">wkf_split()</field>
        </record>
        
        <record id="trans_validated_split" model="workflow.transition">
            <field name="act_from" ref="act_sale_order_validated" />
            <field name="act_to" ref="act_sale_order_split" />
            <field name="signal">order_confirm</field>
            <field name="condition">split_type_sale_order == 'original_sale_order' and not from_yml_test</field>
        </record>
        
        <!-- new DONE STEP -->
        
        <record id="act_sale_order_split_done" model="workflow.activity">
            <field name="wkf_id" ref="sale.wkf_sale" />
            <field name="flow_stop">True</field>
            <field name="name">split_done</field>
            <field name="kind">function</field>
            <field name="action">wkf_split_done()</field>
        </record>
        
        <record id="trans_split_split_done" model="workflow.transition">
            <field name="act_from" ref="act_sale_order_split" />
            <field name="act_to" ref="act_sale_order_split_done" />
            <field name="condition">True</field>
        </record>
        
        <!-- SHIP_PROCUREMENT STEP -->
        
        <record id="act_sale_order_ship_procurement" model="workflow.activity">
            <field name="wkf_id" ref="sale.wkf_sale" />
            <field name="name">ship_procurement</field>
            <field name="kind">function</field>
            <field name="action">action_ship_proc_create()</field>
        </record>
        
        <record id="trans_validated_ship_procurement" model="workflow.transition">
            <field name="act_from" ref="act_sale_order_validated" />
            <field name="act_to" ref="act_sale_order_ship_procurement" />
            <field name="signal">order_confirm</field>
            <field name="condition">split_type_sale_order != 'original_sale_order' or from_yml_test</field>
        </record>
        
        <record id="trans_ship_procurement_router" model="workflow.transition">
            <field name="act_from" ref="act_sale_order_ship_procurement"/>
            <field name="act_to" ref="sale.act_router"/>
            <field name="condition">test_lines()</field>
        </record>
        
        <!-- MODIFY Transition so ship_procurement is always reached. yml backward compatibility, so procurement orders are created -->
        
        <record id="sale.trans_draft_router" model="workflow.transition">
            <field name="act_from" ref="sale.act_draft"/>
            <field name="act_to" ref="act_sale_order_ship_procurement"/>
            <field name="signal">order_confirm</field>
        </record>

    </data>
</openerp>