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

« back to all changes in this revision

Viewing changes to purchase_override/purchase_workflow.xml

  • Committer: chloups208
  • Date: 2011-09-07 12:58:12 UTC
  • mto: (307.2.1 unifield-wm)
  • mto: This revision was merged to the branch mainline in revision 311.
  • Revision ID: chloups208@chloups208-laptop-20110907125812-dsb1jt93ae6bgfe2
[UF-390]pro forma invoice + shipment object refactoring + pack family object refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="utf-8" ?>
2
 
<openerp>
3
 
    <data>
4
 
    
5
 
        <record id="act_loan" model="workflow.activity">
6
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
7
 
            <field name="name">loan</field>
8
 
            <field name="kind">subflow</field>
9
 
            <field name="subflow_id" search="[('osv','=','sale.order')]" type="int"/>
10
 
            <field name="action">action_sale_order_create()</field>
11
 
        </record>
12
 
        <record id="act_loan_done" model="workflow.activity">
13
 
            <field name="wkf_id" ref="purchase.purchase_order" />
14
 
            <field name="name">loan_done</field>
15
 
        </record>
16
 
        
17
 
        <record id="trans_router_loan" model="workflow.transition">
18
 
            <field name="act_from" ref="purchase.act_router" />
19
 
            <field name="act_to" ref="act_loan" />
20
 
            <field name="condition">need_counterpart()</field>
21
 
        </record>
22
 
        <record id="trans_router_loan_done" model="workflow.transition">
23
 
            <field name="act_from" ref="purchase.act_router" />
24
 
            <field name="act_to" ref="act_loan_done" />
25
 
            <field name="condition">go_to_loan_done()</field>
26
 
        </record>
27
 
        <record id="trans_loan_done" model="workflow.transition">
28
 
            <field name="act_from" ref="act_loan"/>
29
 
            <field name="act_to" ref="act_loan_done"/>
30
 
            <field name="signal">subflow.done</field>
31
 
        </record>
32
 
        <record id="trans_loand_done_end" model="workflow.transition">
33
 
            <field name="act_from" ref="act_loan_done" />
34
 
            <field name="act_to" ref="purchase.act_done" />
35
 
        </record>
36
 
 
37
 
        <!-- Redefine the signal to go from Receipt Exception to Closed states -->
38
 
        <record id="purchase.trans_except_picking_picking_done" model="workflow.transition">
39
 
            <field name="act_from" ref="purchase.act_except_picking" />
40
 
            <field name="act_to" ref="purchase.act_picking_done" />
41
 
            <field name="signal" eval="False" />
42
 
        </record>
43
 
        
44
 
        <!-- Redefine the condition to take into account the DPO process (invoice create at confirmation, but
45
 
             the workflow isn't blocked by the invoicing process) -->
46
 
        <record id="act_dpo_invoice" model="workflow.activity">
47
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
48
 
            <field name="name">dpo_invoice</field>
49
 
            <field name="kind">function</field>
50
 
            <field name="action">action_invoice_create()</field>
51
 
        </record>
52
 
             
53
 
        <record id="trans_router_dpo_invoice" model="workflow.transition">
54
 
            <field name="act_from" ref="purchase.act_router"/>
55
 
            <field name="act_to" ref="act_dpo_invoice"/>
56
 
            <field name="condition">invoice_method=='order' and order_type=='direct'</field>
57
 
        </record>
58
 
        <record id="trans_dpo_invoice_invoice_done" model="workflow.transition">
59
 
            <field name="act_from" ref="act_dpo_invoice"/>
60
 
            <field name="act_to" ref="purchase.act_invoice_done"/>
61
 
        </record>
62
 
        <record id="purchase.trans_router_invoice" model="workflow.transition">
63
 
            <field name="condition">invoice_method=='order' and order_type!='direct'</field>
64
 
        </record>
65
 
        
66
 
        <!-- Modify the action of the approved activity because DPO shouldn't be received
67
 
             if any user hasn't validated the reception at the customer side -->
68
 
        <record id="purchase.act_picking_done" model="workflow.activity">
69
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
70
 
            <field name="name">picking_done</field>
71
 
            <field name="action">wkf_picking_done()</field>
72
 
            <field name="kind">function</field>
73
 
            <field name="signal_send">subflow.delivery_done</field>
74
 
        </record>
75
 
        
76
 
        <!-- Add an activity to wait the confirmation of the reception of the DPO at customer side -->
77
 
        <record id="act_dpo_wait" model="workflow.activity">
78
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
79
 
            <field name="name">dpo_wait</field>
80
 
            <field name="kind">dummy</field>
81
 
        </record>
82
 
        
83
 
        <record id="trans_router_dpo_wait" model="workflow.transition">
84
 
            <field name="act_from" ref="purchase.act_router"/>
85
 
            <field name="act_to" ref="act_dpo_wait"/>
86
 
            <field name="condition">order_type=='direct'</field>
87
 
        </record>
88
 
        <record id="trans_dpo_wait_loan_done" model="workflow.transition">
89
 
                <field name="act_from" ref="act_dpo_wait" />
90
 
                <field name="act_to" ref="act_loan_done" />
91
 
                <field name="signal">dpo_received</field>
92
 
        </record>"
93
 
 
94
 
    <!-- Redefine Cancel and Done activites for Accounting Commitments -->
95
 
        <record id="purchase.act_cancel" model="workflow.activity">
96
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
97
 
            <field name="name">cancel</field>
98
 
            <field name="kind">function</field>
99
 
            <field name="flow_stop" eval="False" />
100
 
            <field name="action">wkf_action_cancel_po()</field>
101
 
            <field name="signal_send">subflow.cancel</field>
102
 
        </record>
103
 
 
104
 
        <record id="purchase.act_done" model="workflow.activity">
105
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
106
 
            <field name="name">done</field>
107
 
            <field name="action">action_done()</field>
108
 
            <field name="kind">function</field>
109
 
            <field name="flow_stop">True</field>
110
 
            <field name="join_mode">AND</field>
111
 
        </record>
112
 
        
113
 
        <!-- CONFIRMED_WAIT state -->
114
 
        
115
 
        <record id="act_confirmed_wait" model="workflow.activity">
116
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
117
 
            <field name="name">confirmed_wait</field>
118
 
            <field name="kind">function</field>
119
 
            <field name="action">wkf_confirm_wait_order()</field>
120
 
        </record>
121
 
        
122
 
        <record id="trans_confirmed_confirmed_wait" model="workflow.transition">
123
 
            <field name="act_from" ref="purchase.act_confirmed" />
124
 
            <field name="act_to" ref="act_confirmed_wait" />
125
 
            <field name="signal">purchase_confirmed_wait</field>
126
 
            <field name="condition">check_if_product()</field>
127
 
        </record>
128
 
        
129
 
        <!-- TRIGGER_SO_PO state -->
130
 
        
131
 
        <record id="act_trigger_so_po" model="workflow.activity">
132
 
            <field name="wkf_id" ref="purchase.purchase_order"/>
133
 
            <field name="name">trigger_so_po</field>
134
 
            <field name="kind">function</field>
135
 
            <field name="action">wkf_confirm_trigger()</field>
136
 
        </record>
137
 
 
138
 
        <record id="act_cancel_stop" model="workflow.activity">
139
 
            <field name="wkf_id" ref="purchase.purchase_order" />
140
 
            <field name="name">cancel_stop</field>
141
 
            <field name="kind">function</field>
142
 
            <field name="flow_stop">True</field>
143
 
            <field name="action">wkf_confirm_cancel()</field>
144
 
        </record>
145
 
 
146
 
        <record id="trans_cancel_stop" model="workflow.transition">
147
 
            <field name="act_from" ref="purchase.act_cancel" />
148
 
            <field name="act_to" ref="act_cancel_stop" />
149
 
        </record>
150
 
        
151
 
        <record id="trans_confirmed_wait_trigger_so_po" model="workflow.transition">
152
 
            <field name="act_from" ref="act_confirmed_wait" />
153
 
            <field name="act_to" ref="act_trigger_so_po" />
154
 
            <field name="condition">all_po_confirmed()</field>
155
 
        </record>
156
 
        
157
 
        <record id="trans_trigger_so_po_router" model="workflow.transition">
158
 
            <field name="act_from" ref="act_trigger_so_po" />
159
 
            <field name="act_to" ref="purchase.act_router" />
160
 
        </record>
161
 
 
162
 
    </data>
163
 
</openerp>