68
68
!python {model: sale.order.followup}: |
69
69
assert len(self.search(cr, uid, [])) == 1, "Wrong number of created wizard"
71
(Step 1) I check if the wizard is related to the sale order and if the information is ok
71
I check if the wizard is related to the sale order and if the information is ok
73
73
!python {model: sale.order.followup}: |
74
74
wiz_ids = self.search(cr, uid, [])
75
75
for wiz in self.browse(cr, uid, wiz_ids):
76
76
assert wiz.order_id.id == ref('sales_followup.so1'), "The created wizard is not linked to the Sale Order (1)"
77
assert wiz.state == 'Draft', "The state on the wizard is different than the state of the Sale Order (1)"
77
assert wiz.state == 'Quotation', "The state on the wizard is different than the state of the Sale Order (1)"
78
78
assert len(wiz.line_ids) == 4, "Number of lines in the follow-up not corresponding to the number of lines in the sale order (1)"
79
79
for line in wiz.line_ids:
80
80
if line.product_id.id == ref('product1'):
81
81
assert line.sourced_ok == 'No', "Sourced is not equal to 'No' (1/P1)"
82
82
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (1/P1)"
83
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (1/P1)"
83
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (1/P1)"
84
84
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (1/P1)"
85
assert line.purchase_status == 'No order (0)', "The purchase status is different than 'No order (0)' (1/P1)"
85
assert line.purchase_status == 'No order', "The purchase status is different than 'No order' (1/P1)"
86
86
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (1/P1)"
87
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (1/P1)"
88
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (1/P1)"
87
assert line.incoming_status == 'No shipment', "The incoming status is different than 'No shipment' (1/P1)"
88
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (1/P1)"
89
89
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (1/P1)"
90
90
assert len(line.outgoing_ids) == 0, "Number of outgoing deliveries is different than 0 (1/P1)"
91
assert line.outgoing_status == 'No deliveries (0)', "Outgoing status is different than 'No deliveries (0)' (1/P1)"
91
assert line.outgoing_status == 'No deliveries', "Outgoing status is different than 'No deliveries' (1/P1)"
93
93
if line.product_id.id == ref('product2'):
94
94
assert line.sourced_ok == 'No', "Sourced is not equal to 'No' (1/P2)"
95
95
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (1/P2)"
96
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (1/P2)"
96
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (1/P2)"
97
97
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (1/P2)"
98
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (1/P2)"
98
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (1/P2)"
99
99
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (1/P2)"
100
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (1/P2)"
101
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (1/P2)"
100
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (1/P2)"
101
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (1/P2)"
102
102
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (1/P2)"
103
103
assert len(line.outgoing_ids) == 0, "Number of outgoing deliveries is different than 0 (1/P2)"
104
assert line.outgoing_status == 'No deliveries (0)', "Outgoing status is different than 'No deliveries (0)' (1/P2)"
104
assert line.outgoing_status == 'No deliveries', "Outgoing status is different than 'No deliveries' (1/P2)"
106
if line.product_id.id == ref('product3'):
106
if line.product_id.id == ref('product3'):
107
107
assert line.sourced_ok == 'No', "Sourced is not equal to 'No' (1/P3)"
108
108
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (1/P3)"
109
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (1/P3)"
109
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (1/P3)"
110
110
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (1/P3)"
111
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (1/P3)"
111
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (1/P3)"
112
112
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (1/P3)"
113
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (1/P3)"
114
assert line.product_available == 'Waiting (2000.0)', "The product availability is not 'Waiting (2000.0)' (1/P3)"
113
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (1/P3)"
114
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (1/P3)"
115
115
assert line.available_qty == 2000.0, "The available qty is not equal to 2000.00 (1/P3)"
116
116
assert len(line.outgoing_ids) == 0, "Number of outgoing deliveries is different than 0 (1/P3)"
117
assert line.outgoing_status == 'No deliveries (0)', "Outgoing status is different than 'No deliveries (0)' (1/P3)"
117
assert line.outgoing_status == 'No deliveries', "Outgoing status is different than 'No deliveries' (1/P3)"
119
119
if line.product_id.id == ref('product4'):
120
120
assert line.sourced_ok == 'No', "Sourced is not equal to 'No' (1/P4)"
121
121
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (1/P4)"
122
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (1/P4)"
122
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (1/P4)"
123
123
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (1/P4)"
124
assert line.purchase_status == 'No order (0)', "The purchase status is different than 'No order (0)' (1/P4)"
124
assert line.purchase_status == 'No order', "The purchase status is different than 'No order' (1/P4)"
125
125
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (1/P4)"
126
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (1/P4)"
127
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (1/P4)"
126
assert line.incoming_status == 'No shipment', "The incoming status is different than 'No shipment' (1/P4)"
127
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (1/P4)"
128
128
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (1/P4)"
129
129
assert len(line.outgoing_ids) == 0, "Number of outgoing deliveries is different than 0 (1/P4)"
130
assert line.outgoing_status == 'No deliveries (0)', "Outgoing status is different than 'No deliveries (0)' (1/P4)"
130
assert line.outgoing_status == 'No deliveries', "Outgoing status is different than 'No deliveries' (1/P4)"
132
132
self.unlink(cr, uid, wiz_ids)
134
134
I confirm the sale order
136
136
!workflow {model: sale.order, action: order_confirm, ref: so1}
139
138
I create again a wizard
155
154
for line in wiz.line_ids:
156
155
if line.product_id.id == ref('product1'):
157
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (2/P1)"
156
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (2/P1)"
158
157
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (2/P1)"
159
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (2/P1)"
158
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (2/P1)"
160
159
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (2/P1)"
161
assert line.purchase_status == 'No order (0)', "The purchase status is different than 'No order (0)' (2/P1)"
160
assert line.purchase_status == 'No order', "The purchase status is different than 'No order' (2/P1)"
162
161
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (2/P1)"
163
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (2/P1)"
164
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (2/P1)"
162
assert line.incoming_status == 'No shipment', "The incoming status is different than 'No shipment' (2/P1)"
163
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (2/P1)"
165
164
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (2/P1)"
166
165
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (2/P1)"
167
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (2/P1)"
166
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (2/P1)"
169
168
if line.product_id.id == ref('product2'):
170
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (2/P2)"
169
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (2/P2)"
171
170
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (2/P2)"
172
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (2/P2)"
171
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (2/P2)"
173
172
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (2/P2)"
174
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (2/P2)"
173
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (2/P2)"
175
174
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (2/P2)"
176
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (2/P2)"
177
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (2/P2)"
175
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (2/P2)"
176
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (2/P2)"
178
177
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (2/P2)"
179
178
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (2/P2)"
180
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)'(2/P2)"
179
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting'(2/P2)"
182
181
if line.product_id.id == ref('product3'):
183
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (2/P3)"
182
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (2/P3)"
184
183
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (2/P3)"
185
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (2/P3)"
184
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (2/P3)"
186
185
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (2/P3)"
187
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (2/P3)"
186
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (2/P3)"
188
187
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (2/P3)"
189
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (2/P3)"
190
assert line.product_available == 'Available (2000.0)', "The product availability is not 'Available (2000.0)' (2/P3)"
188
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (2/P3)"
189
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (2/P3)"
191
190
assert line.available_qty == 2000.0, "The available qty is not equal to 2000.00 (2/P3)"
192
191
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (2/P3)"
193
assert line.outgoing_status == 'Available (1)', "Outgoing status is different than 'Waiting (1)' (2/P3)"
192
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (2/P3)"
195
194
if line.product_id.id == ref('product4'):
196
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (2/P4)"
195
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (2/P4)"
197
196
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (2/P4)"
198
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (2/P4)"
197
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (2/P4)"
199
198
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (2/P4)"
200
assert line.purchase_status == 'No order (0)', "The purchase status is different than 'No order (0)' (2/P4)"
199
assert line.purchase_status == 'No order', "The purchase status is different than 'No order' (2/P4)"
201
200
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (2/P4)"
202
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (2/P4)"
203
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (2/P4)"
201
assert line.incoming_status == 'No shipment', "The incoming status is different than 'No shipment' (2/P4)"
202
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (2/P4)"
204
203
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (2/P4)"
205
204
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (2/P4)"
206
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (2/P4)"
205
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (2/P4)"
207
206
self.unlink(cr, uid, wiz_ids)
209
208
I run the scheduler.
211
!python {model: procurement.order}: |
212
self.run_scheduler(cr, uid , context={'update_mode':'init'})
210
!function {model: procurement.order, name: run_scheduler}:
211
- model: procurement.order
214
214
I create again a wizard
231
231
for line in wiz.line_ids:
232
232
if line.product_id.id == ref('product1'):
233
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (3/P1)"
233
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (3/P1)"
234
234
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (3/P1)"
235
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (3/P1)"
235
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (3/P1)"
236
236
assert len(line.purchase_ids) == 1, "Number of PO is different than 0 (3/P1)"
237
assert line.purchase_status == 'Draft (1)', "The purchase status is different than 'Draft (1)' (3/P1)"
237
assert line.purchase_status == 'Draft', "The purchase status is different than 'Draft' (3/P1)"
238
238
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (3/P1)"
239
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (3/P1)"
240
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (3/P1)"
239
assert line.incoming_status == 'No shipment', "The incoming status is different than 'No shipment' (3/P1)"
240
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (3/P1)"
241
241
assert line.available_qty == 0.0, "The available qty is not equal to 0.00 (3/P1)"
242
242
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (3/P1)"
243
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (3/P1)"
243
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (3/P1)"
245
245
for quotation in line.purchase_ids:
246
for o_line in quotation.order_line:
247
self.pool.get('purchase.order.line').write(cr, uid, o_line.id, {'price_unit': 6000})
248
246
wf_service = netsvc.LocalService("workflow")
249
247
wf_service.trg_validate(uid, 'purchase.order', quotation.id, 'purchase_confirm', cr)
251
249
if line.product_id.id == ref('product2'):
252
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (3/P2)"
250
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (3/P2)"
253
251
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (3/P2)"
254
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (3/P2)"
252
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (3/P2)"
255
253
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (3/P2)"
256
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (3/P2)"
254
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (3/P2)"
257
255
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (3/P2)"
258
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (3/P2)"
259
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (3/P2)"
256
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (3/P2)"
257
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (3/P2)"
260
258
assert line.available_qty == 0.0, "The available qty is not equal to 0.00 (3/P2)"
261
259
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (3/P2)"
262
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (3/P2)"
260
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (3/P2)"
264
262
if line.product_id.id == ref('product3'):
265
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (3/P3)"
263
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (3/P3)"
266
264
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (3/P3)"
267
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (3/P3)"
265
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (3/P3)"
268
266
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (3/P3)"
269
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (3/P3)"
267
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (3/P3)"
270
268
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (3/P3)"
271
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (3/P3)"
272
assert line.product_available == 'Available (2000.0)', "The product availability is not 'Available (2000.0)' (3/P3)"
269
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (3/P3)"
270
assert line.product_available == 'Available', "The product availability is not 'Available' (3/P3)"
273
271
assert line.available_qty == 2000.0, "The available qty is not equal to 2000.00 (3/P3)"
274
272
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (3/P3)"
275
assert line.outgoing_status == 'Available (1)', "Outgoing status is different than 'Available (1)' (3/P3)"
273
assert line.outgoing_status == 'Available', "Outgoing status is different than 'Available' (3/P3)"
277
275
if line.product_id.id == ref('product4'):
278
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (3/P4)"
276
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (3/P4)"
279
277
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (3/P4)"
280
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (3/P4)"
278
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (3/P4)"
281
279
assert len(line.purchase_ids) == 1, "Number of PO is different than 1 (3/P4)"
282
assert line.purchase_status == 'Draft (1)', "The purchase status is different than 'Draft (1)' (3/P4)"
280
assert line.purchase_status == 'Draft', "The purchase status is different than 'Draft' (3/P4)"
283
281
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (3/P4)"
284
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (3/P4)"
282
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (3/P4)"
285
283
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (3/P4)"
286
284
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (3/P4)"
287
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (3/P4)"
285
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (3/P4)"
289
287
for quotation in line.purchase_ids:
290
for o_line in quotation.order_line:
291
self.pool.get('purchase.order.line').write(cr, uid, o_line.id, {'price_unit': 6000})
292
288
wf_service = netsvc.LocalService("workflow")
293
289
wf_service.trg_validate(uid, 'purchase.order', quotation.id, 'purchase_confirm', cr)
312
308
assert len(wiz.line_ids) == 4, "Number of lines in the follow-up not corresponding to the number of lines in the sale order (4)"
314
310
for line in wiz.line_ids:
316
311
if line.product_id.id == ref('product1'):
317
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (4/P1)"
312
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (4/P1)"
318
313
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (4/P1)"
319
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (4/P1)"
314
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (4/P1)"
320
315
assert len(line.purchase_ids) == 1, "Number of PO is different than 1 (4/P1)"
321
assert line.purchase_status == 'Validated (1)', "The purchase status is different than 'Validated (1)' (4/P1)"
316
assert line.purchase_status == 'Confirmed', "The purchase status is different than 'Confirmed' (4/P1)"
322
317
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (4/P1)"
323
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (4/P1)"
324
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (4/P1)"
318
assert line.incoming_status == 'No shipment', "The incoming status is different than 'Mo shipment' (4/P1)"
319
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (4/P1)"
325
320
assert line.available_qty == 0.0, "The available qty is not equal to 0.00 (4/P1)"
326
321
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (4/P1)"
327
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (4/P1)"
322
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (4/P1)"
324
for quotation in line.purchase_ids:
325
wf_service = netsvc.LocalService("workflow")
326
wf_service.trg_validate(uid, 'purchase.order', quotation.id, 'purchase_approve', cr)
329
328
if line.product_id.id == ref('product2'):
330
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (4/P2)"
329
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (4/P2)"
331
330
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (4/P2)"
332
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (4/P2)"
331
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (4/P2)"
333
332
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (4/P2)"
334
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (4/P2)"
333
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (4/P2)"
335
334
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (4/P2)"
336
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (4/P2)"
337
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (4/P2)"
335
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (4/P2)"
336
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (4/P2)"
338
337
assert line.available_qty == 0.0, "The available qty is not equal to 0.00 (4/P2)"
339
338
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (4/P2)"
340
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (4/P2)"
339
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (4/P2)"
342
341
if line.product_id.id == ref('product3'):
343
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (4/P3)"
342
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (4/P3)"
344
343
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (4/P3)"
345
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (4/P3)"
344
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (4/P3)"
346
345
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (4/P3)"
347
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (4/P3)"
346
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (4/P3)"
348
347
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (4/P3)"
349
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (4/P3)"
350
assert line.product_available == 'Available (2000.0)', "The product availability is not 'Available (2000.0)' (4/P3)"
348
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (4/P3)"
349
assert line.product_available == 'Available', "The product availability is not 'Available' (4/P3)"
351
350
assert line.available_qty == 2000.0, "The available qty is not equal to 2000.00 (4/P3)"
352
351
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (4/P3)"
353
assert line.outgoing_status == 'Available (1)', "Outgoing status is different than 'Available (1)' (4/P3)"
352
assert line.outgoing_status == 'Available', "Outgoing status is different than 'Available' (4/P3)"
354
353
for move in line.outgoing_ids:
355
354
self.pool.get('stock.move').action_assign(cr, uid, [move.id])
357
356
if line.product_id.id == ref('product4'):
358
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (4/P4)"
357
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (4/P4)"
359
358
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (4/P4)"
360
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (4/P4)"
359
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (4/P4)"
361
360
assert len(line.purchase_ids) == 1, "Number of PO is different than 1 (4/P4)"
362
assert line.purchase_status == 'Validated (1)', "The purchase status is different than 'Validated (1)' (4/P4)"
361
assert line.purchase_status == 'Confirmed', "The purchase status is different than 'Confirmed' (4/P4)"
363
362
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (4/P4)"
364
assert line.incoming_status == 'No shipment (0)', "The incoming status is different than 'No shipment (0)' (4/P4)"
365
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (4/P4)"
363
assert line.incoming_status == 'No shipment', "The incoming status is different than 'No shipment' (4/P4)"
364
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (4/P4)"
366
365
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (4/P4)"
367
366
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (4/P4)"
368
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (4/P4)"
367
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (4/P4)"
370
369
for quotation in line.purchase_ids:
371
# Delivery confirmed date is mandatory at confirmed state (unifield naming) (== 'approved' state openERP naming)
372
quotation.write({'delivery_confirmed_date': '2012-03-03'}, context=context)
373
370
wf_service = netsvc.LocalService("workflow")
374
371
wf_service.trg_validate(uid, 'purchase.order', quotation.id, 'purchase_approve', cr)
395
392
for line in wiz.line_ids:
396
393
if line.product_id.id == ref('product1'):
397
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (5/P1)"
394
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (5/P1)"
398
395
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (5/P1)"
399
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (5/P1)"
396
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (5/P1)"
400
397
assert len(line.purchase_ids) == 1, "Number of PO is different than 1 (5/P1)"
401
assert line.purchase_status == 'Confirmed (1)', "The purchase status is different than 'Confirmed (1)' (5/P1)"
398
assert line.purchase_status == 'Approved', "The purchase status is different than 'Approved' (5/P1)"
402
399
assert len(line.incoming_ids) == 1, "Number of Incoming shipment is different than 1 (5/P1)"
403
assert line.incoming_status == 'Available (1)', "The incoming status is different than 'Available (1)' (5/P1)"
404
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (5/P1)"
400
assert line.incoming_status == 'Available', "The incoming status is different than 'Available' (5/P1)"
401
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (5/P1)"
405
402
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (5/P1)"
406
403
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (5/P1)"
407
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (5/P1)"
404
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (5/P1)"
409
406
if line.product_id.id == ref('product2'):
410
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (5/P2)"
407
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (5/P2)"
411
408
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (5/P2)"
412
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (5/P2)"
409
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (5/P2)"
413
410
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (5/P2)"
414
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (5/P2)"
411
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (5/P2)"
415
412
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (5/P2)"
416
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (5/P2)"
417
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (5/P2)"
413
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (5/P2)"
414
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (5/P2)"
418
415
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (5/P2)"
419
416
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (5/P2)"
420
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (5/P2)"
417
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (5/P2)"
422
if line.product_id.id == ref('product3'):
423
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (5/P3)"
419
if line.product_id.id == ref('product3'):
420
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (5/P3)"
424
421
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (5/P3)"
425
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (5/P3)"
422
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (5/P3)"
426
423
assert len(line.purchase_ids) == 0, "Number of PO is different than 0 (5/P3)"
427
assert line.purchase_status == 'N/A (0)', "The purchase status is not 'N/A (0)' (5/P3)"
424
assert line.purchase_status == 'N/A', "The purchase status is not 'N/A' (5/P3)"
428
425
assert len(line.incoming_ids) == 0, "Number of Incoming shipment is different than 0 (5/P3)"
429
assert line.incoming_status == 'N/A (0)', "The incoming status is not 'N/A (0)' (5/P3)"
430
assert line.product_available == 'Available (2000.0)', "The product availability is not 'Available (2000.0)' (5/P3)"
426
assert line.incoming_status == 'N/A', "The incoming status is not 'N/A' (5/P3)"
427
assert line.product_available == 'Available', "The product availability is not 'Available' (5/P3)"
431
428
assert line.available_qty == 2000.0, "The available qty is not equal to 2000.00 (5/P3)"
432
429
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (5/P3)"
433
assert line.outgoing_status == 'Available (1)', "Outgoing status is different than 'Available (1)' (5/P3)"
430
assert line.outgoing_status == 'Available', "Outgoing status is different than 'Available' (5/P3)"
434
431
for out in line.outgoing_ids:
435
432
self.pool.get('stock.move').action_done(cr, uid, out.id)
437
434
if line.product_id.id == ref('product4'):
438
assert line.sourced_ok == 'Closed', "Sourced is not equal to 'Closed' (5/P4)"
435
assert line.sourced_ok == 'Done', "Sourced is not equal to 'Done' (5/P4)"
439
436
assert len(line.tender_ids) == 0, "Number of calls for tender is different than 0 (5/P4)"
440
assert line.tender_status == 'N/A (0)', "Tender status is different than 'N/A (0)' (5/P4)"
437
assert line.tender_status == 'N/A', "Tender status is different than 'N/A' (5/P4)"
441
438
assert len(line.purchase_ids) == 1, "Number of PO is different than 1 (5/P4)"
442
assert line.purchase_status == 'Confirmed (1)', "The purchase status is different than 'Confirmed (1)' (5/P4)"
439
assert line.purchase_status == 'Approved', "The purchase status is different than 'Approved' (5/P4)"
443
440
assert len(line.incoming_ids) == 1, "Number of Incoming shipment is different than 1 (5/P4)"
444
assert line.incoming_status == 'Available (1)', "The incoming status is different than 'Available (1)' (5/P4)"
445
assert line.product_available == 'Waiting (0.0)', "The product availability is not 'Waiting (0.0)' (5/P4)"
441
assert line.incoming_status == 'Available', "The incoming status is different than 'Available' (5/P4)"
442
assert line.product_available == 'Waiting', "The product availability is not 'Waiting' (5/P4)"
446
443
assert line.available_qty == 0.00, "The available qty is not equal to 0.00 (5/P4)"
447
444
assert len(line.outgoing_ids) == 1, "Number of outgoing deliveries is different than 1 (5/P4)"
448
assert line.outgoing_status == 'Waiting (1)', "Outgoing status is different than 'Waiting (1)' (5/P4)"
445
assert line.outgoing_status == 'Waiting', "Outgoing status is different than 'Waiting' (5/P4)"
450
447
self.unlink(cr, uid, wiz_ids)