~unifield-team/unifield-wm/us-671-homere

« back to all changes in this revision

Viewing changes to procurement_cycle/test/data.yml

[UF-43] fix added noupdate to demo data

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
  !record {model: res.partner, id: supplier1}:
21
21
    name: S1
22
22
    supplier: True
23
 
    supplier_lt: 12
24
23
-
25
24
    I create the address for S1
26
25
-
33
32
  !record {model: res.partner, id: supplier2}:
34
33
    name: S2
35
34
    supplier: True
36
 
    supplier_lt: 45
37
35
-
38
36
    I create the address for S2
39
37
-
61
59
    And a second category
62
60
-
63
61
  !record {model: product.category, id: product_cat2}:
64
 
    name: Categ2
 
62
    name: Categ1
65
63
-
66
64
    I create the product P1
67
65
-
90
88
      - sequence: 10
91
89
        min_qty: 0.00
92
90
        name: supplier1
 
91
        delay: 12
93
92
      - sequence: 20
94
93
        min_qty: 0.00
95
94
        name: supplier2
96
 
    international_status: product_attributes.int_1
 
95
        delay: 45
97
96
-
98
97
    I create a second product, P2
99
98
-
122
121
      - sequence: 10
123
122
        min_qty: 0.00
124
123
        name: supplier2
 
124
        delay: 25
125
125
      - sequence: 20
126
126
        min_qty: 0.00
127
127
        name: supplier1
128
 
    international_status: product_attributes.int_1
 
128
        delay: 20
129
129
-
130
130
    I create the product P3
131
131
-
150
150
    weight: 0.0
151
151
    weight_net: 0.0
152
152
    reviewed_consumption: 30
153
 
    batch_management: True
154
153
    seller_ids:
155
154
      - sequence: 10
156
155
        min_qty: 0.00
157
156
        delay: 30
158
157
        name: supplier1
159
 
    international_status: product_attributes.int_1
160
158
-
161
159
    I create the product P4
162
160
-
186
184
        min_qty: 0.00
187
185
        delay: 60
188
186
        name: supplier1
189
 
    international_status: product_attributes.int_1
190
187
-
191
188
  In order to check the real stock, I will create four SLoc with Sloc3 and Sloc4 which are children of Sloc2
192
189
-
221
218
  !record {model: stock.warehouse, id: warehouse_proc_cycle}:
222
219
    name: Warehouse Cycle
223
220
    lot_stock_id: cycle_sloc2
224
 
    lot_input_id: cycle_sloc2
225
 
    lot_dispatch_id: cycle_sloc2
 
221
    lot_input_id: stock.stock_location_suppliers
226
222
    lot_output_id: stock.stock_location_customers
227
223
    company_id: base.main_company
228
224
-
233
229
    name: Cycle Shop
234
230
    warehouse_id: warehouse_proc_cycle
235
231
-
236
 
  I create a batch for product 3 with today + 2 months as expiry date
237
 
-
238
 
  !record {model: stock.production.lot, id: lot1}:
239
 
    name: '0001'
240
 
    ref: '0001'
241
 
    product_id: product3
242
 
243
 
  I add the life date on the lot
244
 
-
245
 
  !python {model: stock.production.lot }: |
246
 
    import time
247
 
    from datetime import datetime
248
 
    from dateutil.relativedelta import relativedelta
249
 
    req_date = (datetime.strptime(time.strftime('%Y-%m-%d'), '%Y-%m-%d') + relativedelta(months=2)).strftime('%Y-%m-%d')
250
 
    self.write(cr, uid, ref('lot1'), {'life_date': req_date}, context=context)
251
 
-
252
 
  I create a batch for product 3 with today + 1 month as expiry date
253
 
-
254
 
  !record {model: stock.production.lot, id: lot2}:
255
 
    name: '0002'
256
 
    ref: '0002'
257
 
    product_id: product3
258
 
259
 
  I add the life date on the lot
260
 
-
261
 
  !python {model: stock.production.lot }: |
262
 
    import time
263
 
    from datetime import datetime
264
 
    from dateutil.relativedelta import relativedelta
265
 
    req_date = (datetime.strptime(time.strftime('%Y-%m-%d'), '%Y-%m-%d') + relativedelta(months=1)).strftime('%Y-%m-%d')
266
 
    self.write(cr, uid, ref('lot2'), {'life_date': req_date}, context=context)
267
 
-
268
 
  I create a batch for product 3 with today + 15 days as expiry date
269
 
-
270
 
  !record {model: stock.production.lot, id: lot3}:
271
 
    name: '0003'
272
 
    ref: '0003'
273
 
    product_id: product3
274
 
275
 
  I add the life date on the lot
276
 
-
277
 
  !python {model: stock.production.lot }: |
278
 
    import time
279
 
    from datetime import datetime
280
 
    from dateutil.relativedelta import relativedelta
281
 
    req_date = (datetime.strptime(time.strftime('%Y-%m-%d'), '%Y-%m-%d') + relativedelta(days=15)).strftime('%Y-%m-%d')
282
 
    self.write(cr, uid, ref('lot3'), {'life_date': req_date}, context=context)
283
 
-
284
 
  I create a batch for product 3 with today + 6 months as expiry date
285
 
-
286
 
  !record {model: stock.production.lot, id: lot4}:
287
 
    name: '0004'
288
 
    ref: '0004'
289
 
    product_id: product3
290
 
291
 
  I add the life date on the lot
292
 
-
293
 
  !python {model: stock.production.lot }: |
294
 
    import time
295
 
    from datetime import datetime
296
 
    from dateutil.relativedelta import relativedelta
297
 
    req_date = (datetime.strptime(time.strftime('%Y-%m-%d'), '%Y-%m-%d') + relativedelta(months=6)).strftime('%Y-%m-%d')
298
 
    self.write(cr, uid, ref('lot4'), {'life_date': req_date}, context=context)
299
 
-
300
 
  I create a batch for product 3 with today + 2 years as expiry date
301
 
-
302
 
  !record {model: stock.production.lot, id: lot5}:
303
 
    name: '0005'
304
 
    ref: '0005'
305
 
    product_id: product3
306
 
307
 
  I add the life date on the lot
308
 
-
309
 
  !python {model: stock.production.lot }: |
310
 
    import time
311
 
    from datetime import datetime
312
 
    from dateutil.relativedelta import relativedelta
313
 
    req_date = (datetime.strptime(time.strftime('%Y-%m-%d'), '%Y-%m-%d') + relativedelta(years=2)).strftime('%Y-%m-%d')
314
 
    self.write(cr, uid, ref('lot5'), {'life_date': req_date}, context=context)
315
 
-
316
 
  !record {model: stock.production.lot, id: lot22}:
317
 
    name: '00022'
318
 
    ref: '00022'
319
 
    product_id: product3
320
 
    life_date: !eval "(DateTime.now()+DateTime.RelativeDateTime(months=1)).strftime('%Y-%m-%d')"
321
 
 
322
 
-
323
232
  I create an inventory to add products in stock
324
233
-
325
234
  !record {model: stock.inventory, id: inv1}:
356
265
      - company_id: base.main_company
357
266
        location_id: cycle_sloc1
358
267
        product_id: product3
359
 
        prod_lot_id: lot22
360
 
        product_qty: 500.0
361
 
        product_uom: product.product_uom_unit
362
 
      - company_id: base.main_company
363
 
        location_id: cycle_sloc2
364
 
        product_id: product3
365
 
        product_qty: 40.0
366
 
        prod_lot_id: lot1
367
 
        product_uom: product.product_uom_unit
368
 
      - company_id: base.main_company
369
 
        location_id: cycle_sloc2
370
 
        product_id: product3
371
 
        product_qty: 5.00
372
 
        prod_lot_id: lot3
373
 
        product_uom: product.product_uom_unit
374
 
      - company_id: base.main_company
375
 
        location_id: cycle_sloc2
376
 
        product_id: product3
377
 
        product_qty: 250.00
378
 
        prod_lot_id: lot4
379
 
        product_uom: product.product_uom_unit
380
 
      - company_id: base.main_company
381
 
        location_id: cycle_sloc2
382
 
        product_id: product3
383
 
        product_qty: 500.00
384
 
        prod_lot_id: lot5
 
268
        product_qty: 15.0
 
269
        product_uom: product.product_uom_unit
 
270
      - company_id: base.main_company
 
271
        location_id: cycle_sloc2
 
272
        product_id: product3
 
273
        product_qty: 55.0
385
274
        product_uom: product.product_uom_unit
386
275
      - company_id: base.main_company
387
276
        location_id: cycle_sloc3
388
277
        product_id: product3
389
278
        product_qty: 10.0
390
 
        prod_lot_id: lot1
391
279
        product_uom: product.product_uom_unit
392
280
      - company_id: base.main_company
393
281
        location_id: cycle_sloc4
394
282
        product_id: product3
395
283
        product_qty: 25.0
396
 
        prod_lot_id: lot2
397
284
        product_uom: product.product_uom_unit
398
285
      - company_id: base.main_company
399
286
        location_id: cycle_sloc2
431
318
        product_uom_qty: 15.0
432
319
        product_uos_qty: 15.0
433
320
        state: draft
434
 
        type: make_to_stock
 
321
        type: make_to_order
435
322
    order_policy: manual
436
323
    partner_id: cust1
437
324
    partner_invoice_id: addrc1
454
341
  I check if the availability of P3 is correct
455
342
-
456
343
  !assert {model: product.product, id: product3}:
457
 
    - qty_available == 830.0
458
 
    - virtual_available == 830.0
 
344
    - qty_available == 90.0
 
345
    - virtual_available == 90.0
459
346
-
460
347
  I create a Purchase Order with 35 P3
461
348
-
476
363
    partner_id: supplier1
477
364
    pricelist_id: purchase.list0
478
365
-
479
 
  I validate this purchase order
 
366
  I confirm this purchase order
480
367
-
481
368
  !workflow {model: purchase.order, action: purchase_confirm, ref: po1}
482
369
-
483
 
  I approve this purchase order
484
 
-
485
 
  !workflow {model: purchase.order, action: purchase_approve, ref: po1}
486
 
-
487
370
  I check if the availability of P3 is correct
488
371
-
489
372
  !assert {model: product.product, id: product3}:
490
 
    - qty_available == 830.0
491
 
    - virtual_available == 865.0
492
 
-
493
 
  I crete a new FMC report for Sloc 2
494
 
-
495
 
  !record {model: monthly.review.consumption, id: mrc2}:
496
 
    cons_location_id: cycle_sloc2
497
 
    period_from: 2011-01-01
498
 
    period_to: !eval time.strftime('%Y-%m-%d')
499
 
    line_ids:
500
 
      - name: product1
501
 
        fmc: 125.0
502
 
        valid_ok: True
503
 
      - name: product2
504
 
        fmc: 236.0
505
 
        valid_ok: True
506
 
      - name: product3
507
 
        fmc: 150.0
508
 
        valid_ok: True
509
 
-
510
 
  I create a stock move for P1 in SLoc 2
511
 
512
 
  !record {model: stock.move, id: sm_p1_sloc2}:
513
 
    name: Product 1 SLoc 2
514
 
    product_id: product1
515
 
    product_uom: product.product_uom_unit
516
 
    date_expected: !eval time.strftime('%Y-%m-%d')
517
 
    date: !eval time.strftime('%Y-%m-%d')
518
 
    location_id: cycle_sloc2
519
 
    location_dest_id: stock.stock_location_customers
520
 
    type: out
521
 
    reason_type_id: reason_types_moves.reason_type_deliver_partner
522
 
    product_qty: 5
523
 
-
524
 
  I confirm the stock move
525
 
-
526
 
  !python {model: stock.move}: |
527
 
    self.action_confirm(cr, uid, ref('sm_p1_sloc2'), context=context)
528
 
    self.action_done(cr, uid, ref('sm_p1_sloc2'), context=context)
529
 
-
530
 
  I create a stock move for P1 in SLoc 1
531
 
532
 
  !record {model: stock.move, id: sm_p1_sloc1}:
533
 
    name: Product 1 SLoc 1
534
 
    product_id: product1
535
 
    product_uom: product.product_uom_unit
536
 
    date_expected: !eval time.strftime('%Y-%m-%d')
537
 
    date: !eval time.strftime('%Y-%m-%d')
538
 
    location_id: cycle_sloc1
539
 
    location_dest_id: stock.stock_location_customers
540
 
    type: out
541
 
    reason_type_id: reason_types_moves.reason_type_deliver_partner
542
 
    product_qty: 5
543
 
-
544
 
  I confirm the stock move
545
 
-
546
 
  !python {model: stock.move}: |
547
 
    self.action_confirm(cr, uid, ref('sm_p1_sloc1'), context=context)
548
 
    self.action_done(cr, uid, ref('sm_p1_sloc1'), context=context)
549
 
-
550
 
  I create a stock move for P2 in SLoc 1
551
 
552
 
  !record {model: stock.move, id: sm_p2_sloc1}:
553
 
    name: Product 2 SLoc 1
554
 
    product_id: product2
555
 
    product_uom: product.product_uom_unit
556
 
    date_expected: !eval time.strftime('%Y-%m-%d')
557
 
    date: !eval time.strftime('%Y-%m-%d')
558
 
    location_id: cycle_sloc1
559
 
    location_dest_id: stock.stock_location_customers
560
 
    type: out
561
 
    reason_type_id: reason_types_moves.reason_type_deliver_partner
562
 
    product_qty: 7
563
 
-
564
 
  I confirm the stock move
565
 
-
566
 
  !python {model: stock.move}: |
567
 
    self.action_confirm(cr, uid, ref('sm_p2_sloc1'), context=context)
568
 
    self.action_done(cr, uid, ref('sm_p2_sloc1'), context=context)
569
 
-
570
 
  I create a stock move for P2 in SLoc 2
571
 
572
 
  !record {model: stock.move, id: sm_p2_sloc2}:
573
 
    name: Product 2 SLoc 2
574
 
    product_id: product2
575
 
    product_uom: product.product_uom_unit
576
 
    date_expected: !eval time.strftime('%Y-%m-%d')
577
 
    date: !eval time.strftime('%Y-%m-%d')
578
 
    location_id: cycle_sloc2
579
 
    location_dest_id: stock.stock_location_customers
580
 
    type: out
581
 
    reason_type_id: reason_types_moves.reason_type_deliver_partner
582
 
    product_qty: 10
583
 
-
584
 
  I confirm the stock move
585
 
-
586
 
  !python {model: stock.move}: |
587
 
    self.action_confirm(cr, uid, ref('sm_p2_sloc2'), context=context)
588
 
    self.action_done(cr, uid, ref('sm_p2_sloc2'), context=context)
589
 
-
590
 
  I create a stock move for P3 in SLoc 1
591
 
592
 
  !record {model: stock.move, id: sm_p3_sloc1}:
593
 
    name: Product 3 SLoc 1
594
 
    product_id: product3
595
 
    product_uom: product.product_uom_unit
596
 
    date_expected: !eval time.strftime('%Y-%m-%d')
597
 
    date: !eval time.strftime('%Y-%m-%d')
598
 
    location_id: cycle_sloc1
599
 
    location_dest_id: stock.stock_location_customers
600
 
    type: out
601
 
    prodlot_id: lot22
602
 
    reason_type_id: reason_types_moves.reason_type_deliver_partner
603
 
    product_qty: 12
604
 
-
605
 
  I confirm the stock move
606
 
-
607
 
  !python {model: stock.move}: |
608
 
    self.action_confirm(cr, uid, ref('sm_p3_sloc1'), context=context)
609
 
    self.action_done(cr, uid, ref('sm_p3_sloc1'), context=context)
610
 
-
611
 
  I create a stock move for P2 in SLoc 1
612
 
613
 
  !record {model: stock.move, id: sm_p4_sloc2}:
614
 
    name: Product 4 SLoc 2
615
 
    product_id: product4
616
 
    product_uom: product.product_uom_unit
617
 
    date_expected: !eval time.strftime('%Y-%m-%d')
618
 
    date: !eval time.strftime('%Y-%m-%d')
619
 
    location_id: cycle_sloc2
620
 
    location_dest_id: stock.stock_location_customers
621
 
    type: out
622
 
    reason_type_id: reason_types_moves.reason_type_deliver_partner
623
 
    product_qty: 2
624
 
-
625
 
  I confirm the stock move
626
 
-
627
 
  !python {model: stock.move}: |
628
 
    self.action_confirm(cr, uid, ref('sm_p4_sloc2'), context=context)
629
 
    self.action_done(cr, uid, ref('sm_p4_sloc2'), context=context)
 
373
    - qty_available == 90.0
 
374
    - virtual_available == 125.0
 
 
b'\\ No newline at end of file'