2
In order to test the threshold value feature, I will create different products
3
with different rules and test the behavior
5
<---------------- Defining data ---------------->
7
<---------------- Defining supplier ---------------->
11
!record {model: res.partner, id: supplier1}:
15
I create an address for Supplier 1
17
!record {model: res.partner.address, id: addr_supplier1}:
21
<---------------- Defining product categories ---------------->
25
!record {model: product.category, id: cat1}:
30
!record {model: product.category, id: cat2}:
33
<---------------- Defining products ---------------->
37
!record {model: product.product, id: product1}:
38
categ_id: product.cat0
43
procure_method: make_to_stock
44
property_stock_inventory: stock.location_inventory
45
property_stock_procurement: stock.location_procurement
46
property_stock_production: stock.location_production
51
uom_id: product.product_uom_unit
52
uom_po_id: product.product_uom_unit
57
reviewed_consumption: 45
58
international_status: itc
62
!record {model: product.product, id: product2}:
63
categ_id: product.cat0
68
procure_method: make_to_stock
69
property_stock_inventory: stock.location_inventory
70
property_stock_procurement: stock.location_procurement
71
property_stock_production: stock.location_production
76
uom_id: product.product_uom_unit
77
uom_po_id: product.product_uom_unit
82
reviewed_consumption: 45
83
international_status: itc
87
!record {model: product.product, id: product3}:
88
categ_id: product.cat0
93
procure_method: make_to_stock
94
property_stock_inventory: stock.location_inventory
95
property_stock_procurement: stock.location_procurement
96
property_stock_production: stock.location_production
101
uom_id: product.product_uom_unit
102
uom_po_id: product.product_uom_unit
107
reviewed_consumption: 45
108
international_status: itc
112
!record {model: product.product, id: product4}:
113
categ_id: product.cat0
114
cost_method: standard
118
procure_method: make_to_stock
119
property_stock_inventory: stock.location_inventory
120
property_stock_procurement: stock.location_procurement
121
property_stock_production: stock.location_production
123
standard_price: 100.0
126
uom_id: product.product_uom_unit
127
uom_po_id: product.product_uom_unit
132
reviewed_consumption: 45
133
international_status: itc
137
!record {model: product.product, id: product5}:
138
categ_id: product.cat0
139
cost_method: standard
143
procure_method: make_to_stock
144
property_stock_inventory: stock.location_inventory
145
property_stock_procurement: stock.location_procurement
146
property_stock_production: stock.location_production
148
standard_price: 100.0
151
uom_id: product.product_uom_unit
152
uom_po_id: product.product_uom_unit
157
reviewed_consumption: 45
158
international_status: itc
162
!record {model: product.product, id: product6}:
163
categ_id: product.cat0
164
cost_method: standard
168
procure_method: make_to_stock
169
property_stock_inventory: stock.location_inventory
170
property_stock_procurement: stock.location_procurement
171
property_stock_production: stock.location_production
173
standard_price: 100.0
176
uom_id: product.product_uom_unit
177
uom_po_id: product.product_uom_unit
182
reviewed_consumption: 45
183
international_status: itc
187
!record {model: product.product, id: product7}:
188
categ_id: product.cat0
189
cost_method: standard
193
procure_method: make_to_stock
194
property_stock_inventory: stock.location_inventory
195
property_stock_procurement: stock.location_procurement
196
property_stock_production: stock.location_production
198
standard_price: 100.0
201
uom_id: product.product_uom_unit
202
uom_po_id: product.product_uom_unit
207
reviewed_consumption: 45
208
international_status: itc
212
!record {model: product.product, id: product8}:
213
categ_id: product.cat0
214
cost_method: standard
218
procure_method: make_to_stock
219
property_stock_inventory: stock.location_inventory
220
property_stock_procurement: stock.location_procurement
221
property_stock_production: stock.location_production
223
standard_price: 100.0
226
uom_id: product.product_uom_unit
227
uom_po_id: product.product_uom_unit
232
reviewed_consumption: 45
238
international_status: itc
242
!record {model: product.product, id: product9}:
244
cost_method: standard
248
procure_method: make_to_stock
249
property_stock_inventory: stock.location_inventory
250
property_stock_procurement: stock.location_procurement
251
property_stock_production: stock.location_production
253
standard_price: 100.0
256
uom_id: product.product_uom_unit
257
uom_po_id: product.product_uom_unit
262
reviewed_consumption: 45
263
international_status: itc
267
!record {model: product.product, id: product10}:
269
cost_method: standard
273
procure_method: make_to_stock
274
property_stock_inventory: stock.location_inventory
275
property_stock_procurement: stock.location_procurement
276
property_stock_production: stock.location_production
278
standard_price: 100.0
281
uom_id: product.product_uom_unit
282
uom_po_id: product.product_uom_unit
287
reviewed_consumption: 45
288
international_status: itc
292
!record {model: product.product, id: product11}:
294
cost_method: standard
298
procure_method: make_to_stock
299
property_stock_inventory: stock.location_inventory
300
property_stock_procurement: stock.location_procurement
301
property_stock_production: stock.location_production
303
standard_price: 100.0
306
uom_id: product.product_uom_unit
307
uom_po_id: product.product_uom_unit
312
reviewed_consumption: 45
313
international_status: itc
317
!record {model: product.product, id: product12}:
319
cost_method: standard
323
procure_method: make_to_stock
324
property_stock_inventory: stock.location_inventory
325
property_stock_procurement: stock.location_procurement
326
property_stock_production: stock.location_production
328
standard_price: 100.0
331
uom_id: product.product_uom_unit
332
uom_po_id: product.product_uom_unit
337
reviewed_consumption: 45
338
international_status: itc
340
I create a stock move for product1 to have an AMC different than 0.00
342
!record {model: stock.move, id: sm_amc1}:
344
product_uom: product.product_uom_unit
345
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
346
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
348
location_id: stock.stock_location_stock
349
location_dest_id: stock.stock_location_customers
350
reason_type_id: reason_types_moves.reason_type_deliver_partner
352
name: AMC for product 1
354
I confirm the stock move
356
!python {model: stock.move}: |
357
self.action_confirm(cr, uid, [ref('sm_amc1')], context=context)
358
self.action_done(cr, uid, [ref('sm_amc1')], context=context)
360
I create a stock move for product2 to have an AMC different than 0.00
362
!record {model: stock.move, id: sm_amc2}:
364
product_uom: product.product_uom_unit
365
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
366
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
368
location_id: stock.stock_location_stock
369
location_dest_id: stock.stock_location_customers
370
reason_type_id: reason_types_moves.reason_type_deliver_partner
372
name: AMC for product 2
374
I confirm the stock move
376
!python {model: stock.move}: |
377
self.action_confirm(cr, uid, [ref('sm_amc2')], context=context)
378
self.action_done(cr, uid, [ref('sm_amc2')], context=context)
380
I create a stock move for product3 to have an AMC different than 0.00
382
!record {model: stock.move, id: sm_amc3}:
384
product_uom: product.product_uom_unit
385
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
386
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
388
location_id: stock.stock_location_stock
389
location_dest_id: stock.stock_location_customers
390
reason_type_id: reason_types_moves.reason_type_deliver_partner
392
name: AMC for product 3
394
I confirm the stock move
396
!python {model: stock.move}: |
397
self.action_confirm(cr, uid, [ref('sm_amc3')], context=context)
398
self.action_done(cr, uid, [ref('sm_amc3')], context=context)
400
I create a stock move for product4 to have an AMC different than 0.00
402
!record {model: stock.move, id: sm_amc4}:
404
product_uom: product.product_uom_unit
405
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
406
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
408
location_id: stock.stock_location_stock
409
location_dest_id: stock.stock_location_customers
410
reason_type_id: reason_types_moves.reason_type_deliver_partner
412
name: AMC for product 4
414
I confirm the stock move
416
!python {model: stock.move}: |
417
self.action_confirm(cr, uid, [ref('sm_amc4')], context=context)
418
self.action_done(cr, uid, [ref('sm_amc4')], context=context)
420
I create a stock move for product5 to have an AMC different than 0.00
422
!record {model: stock.move, id: sm_amc5}:
424
product_uom: product.product_uom_unit
425
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
426
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
428
location_id: stock.stock_location_stock
429
location_dest_id: stock.stock_location_customers
430
reason_type_id: reason_types_moves.reason_type_deliver_partner
432
name: AMC for product 5
434
I confirm the stock move
436
!python {model: stock.move}: |
437
self.action_confirm(cr, uid, [ref('sm_amc5')], context=context)
438
self.action_done(cr, uid, [ref('sm_amc5')], context=context)
440
I create a stock move for product6 to have an AMC different than 0.00
442
!record {model: stock.move, id: sm_amc6}:
444
product_uom: product.product_uom_unit
445
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
446
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
448
location_id: stock.stock_location_stock
449
location_dest_id: stock.stock_location_customers
450
reason_type_id: reason_types_moves.reason_type_deliver_partner
452
name: AMC for product 6
454
I confirm the stock move
456
!python {model: stock.move}: |
457
self.action_confirm(cr, uid, [ref('sm_amc6')], context=context)
458
self.action_done(cr, uid, [ref('sm_amc6')], context=context)
460
I create a stock move for product7 to have an AMC different than 0.00
462
!record {model: stock.move, id: sm_amc7}:
464
product_uom: product.product_uom_unit
465
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
466
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
468
location_id: stock.stock_location_stock
469
location_dest_id: stock.stock_location_customers
470
reason_type_id: reason_types_moves.reason_type_deliver_partner
472
name: AMC for product 7
474
I confirm the stock move
476
!python {model: stock.move}: |
477
self.action_confirm(cr, uid, [ref('sm_amc7')], context=context)
478
self.action_done(cr, uid, [ref('sm_amc7')], context=context)
480
I create a stock move for product8 to have an AMC different than 0.00
482
!record {model: stock.move, id: sm_amc8}:
484
product_uom: product.product_uom_unit
485
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
486
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
488
location_id: stock.stock_location_stock
489
location_dest_id: stock.stock_location_customers
490
reason_type_id: reason_types_moves.reason_type_deliver_partner
492
name: AMC for product 8
494
I confirm the stock move
496
!python {model: stock.move}: |
497
self.action_confirm(cr, uid, [ref('sm_amc8')], context=context)
498
self.action_done(cr, uid, [ref('sm_amc8')], context=context)
500
I create a stock move for product9 to have an AMC different than 0.00
502
!record {model: stock.move, id: sm_amc9}:
504
product_uom: product.product_uom_unit
505
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
506
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
508
location_id: stock.stock_location_stock
509
location_dest_id: stock.stock_location_customers
510
reason_type_id: reason_types_moves.reason_type_deliver_partner
512
name: AMC for product 9
514
I confirm the stock move
516
!python {model: stock.move}: |
517
self.action_confirm(cr, uid, [ref('sm_amc9')], context=context)
518
self.action_done(cr, uid, [ref('sm_amc9')], context=context)
520
I create a stock move for product10 to have an AMC different than 0.00
522
!record {model: stock.move, id: sm_amc10}:
523
product_id: product10
524
product_uom: product.product_uom_unit
525
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
526
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
528
location_id: stock.stock_location_stock
529
location_dest_id: stock.stock_location_customers
530
reason_type_id: reason_types_moves.reason_type_deliver_partner
532
name: AMC for product 10
534
I confirm the stock move
536
!python {model: stock.move}: |
537
self.action_confirm(cr, uid, [ref('sm_amc10')], context=context)
538
self.action_done(cr, uid, [ref('sm_amc10')], context=context)
540
I create a stock move for product11 to have an AMC different than 0.00
542
!record {model: stock.move, id: sm_amc11}:
543
product_id: product11
544
product_uom: product.product_uom_unit
545
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
546
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
548
location_id: stock.stock_location_stock
549
location_dest_id: stock.stock_location_customers
550
reason_type_id: reason_types_moves.reason_type_deliver_partner
552
name: AMC for product 11
554
I confirm the stock move
556
!python {model: stock.move}: |
557
self.action_confirm(cr, uid, [ref('sm_amc11')], context=context)
558
self.action_done(cr, uid, [ref('sm_amc11')], context=context)
560
I create a stock move for product12 to have an AMC different than 0.00
562
!record {model: stock.move, id: sm_amc12}:
563
product_id: product12
564
product_uom: product.product_uom_unit
565
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
566
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
568
location_id: stock.stock_location_stock
569
location_dest_id: stock.stock_location_customers
570
reason_type_id: reason_types_moves.reason_type_deliver_partner
572
name: AMC for product 12
574
I confirm the stock move
576
!python {model: stock.move}: |
577
self.action_confirm(cr, uid, [ref('sm_amc12')], context=context)
578
self.action_done(cr, uid, [ref('sm_amc12')], context=context)
580
I create an inventory
582
!record {model: stock.inventory, id: inv1}:
583
company_id: base.main_company
584
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
585
date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
587
- company_id: base.main_company
588
location_id: stock.stock_location_stock
591
product_uom: product.product_uom_unit
592
- company_id: base.main_company
593
location_id: stock.stock_location_stock
596
product_uom: product.product_uom_unit
597
- company_id: base.main_company
598
location_id: stock.stock_location_stock
601
product_uom: product.product_uom_unit
602
- company_id: base.main_company
603
location_id: stock.stock_location_stock
606
product_uom: product.product_uom_unit
607
- company_id: base.main_company
608
location_id: stock.stock_location_stock
611
product_uom: product.product_uom_unit
612
- company_id: base.main_company
613
location_id: stock.stock_location_stock
616
product_uom: product.product_uom_unit
617
- company_id: base.main_company
618
location_id: stock.stock_location_stock
621
product_uom: product.product_uom_unit
622
- company_id: base.main_company
623
location_id: stock.stock_location_stock
626
product_uom: product.product_uom_unit
627
- company_id: base.main_company
628
location_id: stock.stock_location_stock
631
product_uom: product.product_uom_unit
632
- company_id: base.main_company
633
location_id: stock.stock_location_stock
634
product_id: product10
636
product_uom: product.product_uom_unit
637
- company_id: base.main_company
638
location_id: stock.stock_location_stock
639
product_id: product11
641
product_uom: product.product_uom_unit
642
- company_id: base.main_company
643
location_id: stock.stock_location_stock
644
product_id: product12
646
product_uom: product.product_uom_unit
647
name: Physical inventory
650
I confirm the Inventory
652
!python {model: stock.inventory}: |
653
self.action_confirm(cr,uid,[ref('inv1')])
654
self.action_done(cr,uid,[ref('inv1')])