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
61
!record {model: product.product, id: product2}:
62
categ_id: product.cat0
67
procure_method: make_to_stock
68
property_stock_inventory: stock.location_inventory
69
property_stock_procurement: stock.location_procurement
70
property_stock_production: stock.location_production
75
uom_id: product.product_uom_unit
76
uom_po_id: product.product_uom_unit
81
reviewed_consumption: 45
85
!record {model: product.product, id: product3}:
86
categ_id: product.cat0
91
procure_method: make_to_stock
92
property_stock_inventory: stock.location_inventory
93
property_stock_procurement: stock.location_procurement
94
property_stock_production: stock.location_production
99
uom_id: product.product_uom_unit
100
uom_po_id: product.product_uom_unit
105
reviewed_consumption: 45
109
!record {model: product.product, id: product4}:
110
categ_id: product.cat0
111
cost_method: standard
115
procure_method: make_to_stock
116
property_stock_inventory: stock.location_inventory
117
property_stock_procurement: stock.location_procurement
118
property_stock_production: stock.location_production
120
standard_price: 100.0
123
uom_id: product.product_uom_unit
124
uom_po_id: product.product_uom_unit
129
reviewed_consumption: 45
133
!record {model: product.product, id: product5}:
134
categ_id: product.cat0
135
cost_method: standard
139
procure_method: make_to_stock
140
property_stock_inventory: stock.location_inventory
141
property_stock_procurement: stock.location_procurement
142
property_stock_production: stock.location_production
144
standard_price: 100.0
147
uom_id: product.product_uom_unit
148
uom_po_id: product.product_uom_unit
153
reviewed_consumption: 45
157
!record {model: product.product, id: product6}:
158
categ_id: product.cat0
159
cost_method: standard
163
procure_method: make_to_stock
164
property_stock_inventory: stock.location_inventory
165
property_stock_procurement: stock.location_procurement
166
property_stock_production: stock.location_production
168
standard_price: 100.0
171
uom_id: product.product_uom_unit
172
uom_po_id: product.product_uom_unit
177
reviewed_consumption: 45
181
!record {model: product.product, id: product7}:
182
categ_id: product.cat0
183
cost_method: standard
187
procure_method: make_to_stock
188
property_stock_inventory: stock.location_inventory
189
property_stock_procurement: stock.location_procurement
190
property_stock_production: stock.location_production
192
standard_price: 100.0
195
uom_id: product.product_uom_unit
196
uom_po_id: product.product_uom_unit
201
reviewed_consumption: 45
205
!record {model: product.product, id: product8}:
206
categ_id: product.cat0
207
cost_method: standard
211
procure_method: make_to_stock
212
property_stock_inventory: stock.location_inventory
213
property_stock_procurement: stock.location_procurement
214
property_stock_production: stock.location_production
216
standard_price: 100.0
219
uom_id: product.product_uom_unit
220
uom_po_id: product.product_uom_unit
225
reviewed_consumption: 45
234
!record {model: product.product, id: product9}:
236
cost_method: standard
240
procure_method: make_to_stock
241
property_stock_inventory: stock.location_inventory
242
property_stock_procurement: stock.location_procurement
243
property_stock_production: stock.location_production
245
standard_price: 100.0
248
uom_id: product.product_uom_unit
249
uom_po_id: product.product_uom_unit
254
reviewed_consumption: 45
258
!record {model: product.product, id: product10}:
260
cost_method: standard
264
procure_method: make_to_stock
265
property_stock_inventory: stock.location_inventory
266
property_stock_procurement: stock.location_procurement
267
property_stock_production: stock.location_production
269
standard_price: 100.0
272
uom_id: product.product_uom_unit
273
uom_po_id: product.product_uom_unit
278
reviewed_consumption: 45
282
!record {model: product.product, id: product11}:
284
cost_method: standard
288
procure_method: make_to_stock
289
property_stock_inventory: stock.location_inventory
290
property_stock_procurement: stock.location_procurement
291
property_stock_production: stock.location_production
293
standard_price: 100.0
296
uom_id: product.product_uom_unit
297
uom_po_id: product.product_uom_unit
302
reviewed_consumption: 45
306
!record {model: product.product, id: product12}:
308
cost_method: standard
312
procure_method: make_to_stock
313
property_stock_inventory: stock.location_inventory
314
property_stock_procurement: stock.location_procurement
315
property_stock_production: stock.location_production
317
standard_price: 100.0
320
uom_id: product.product_uom_unit
321
uom_po_id: product.product_uom_unit
326
reviewed_consumption: 45
328
I create a stock move for product1 to have an AMC different than 0.00
330
!record {model: stock.move, id: sm_amc1}:
332
product_uom: product.product_uom_unit
333
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
334
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
336
location_id: stock.stock_location_stock
337
location_dest_id: stock.stock_location_customers
338
reason_type_id: reason_types_moves.reason_type_deliver_partner
340
name: AMC for product 1
342
I confirm the stock move
344
!python {model: stock.move}: |
345
self.action_confirm(cr, uid, [ref('sm_amc1')], context=context)
346
self.action_done(cr, uid, [ref('sm_amc1')], context=context)
348
I create a stock move for product2 to have an AMC different than 0.00
350
!record {model: stock.move, id: sm_amc2}:
352
product_uom: product.product_uom_unit
353
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
354
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
356
location_id: stock.stock_location_stock
357
location_dest_id: stock.stock_location_customers
358
reason_type_id: reason_types_moves.reason_type_deliver_partner
360
name: AMC for product 2
362
I confirm the stock move
364
!python {model: stock.move}: |
365
self.action_confirm(cr, uid, [ref('sm_amc2')], context=context)
366
self.action_done(cr, uid, [ref('sm_amc2')], context=context)
368
I create a stock move for product3 to have an AMC different than 0.00
370
!record {model: stock.move, id: sm_amc3}:
372
product_uom: product.product_uom_unit
373
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
374
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
376
location_id: stock.stock_location_stock
377
location_dest_id: stock.stock_location_customers
378
reason_type_id: reason_types_moves.reason_type_deliver_partner
380
name: AMC for product 3
382
I confirm the stock move
384
!python {model: stock.move}: |
385
self.action_confirm(cr, uid, [ref('sm_amc3')], context=context)
386
self.action_done(cr, uid, [ref('sm_amc3')], context=context)
388
I create a stock move for product4 to have an AMC different than 0.00
390
!record {model: stock.move, id: sm_amc4}:
392
product_uom: product.product_uom_unit
393
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
394
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
396
location_id: stock.stock_location_stock
397
location_dest_id: stock.stock_location_customers
398
reason_type_id: reason_types_moves.reason_type_deliver_partner
400
name: AMC for product 4
402
I confirm the stock move
404
!python {model: stock.move}: |
405
self.action_confirm(cr, uid, [ref('sm_amc4')], context=context)
406
self.action_done(cr, uid, [ref('sm_amc4')], context=context)
408
I create a stock move for product5 to have an AMC different than 0.00
410
!record {model: stock.move, id: sm_amc5}:
412
product_uom: product.product_uom_unit
413
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
414
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
416
location_id: stock.stock_location_stock
417
location_dest_id: stock.stock_location_customers
418
reason_type_id: reason_types_moves.reason_type_deliver_partner
420
name: AMC for product 5
422
I confirm the stock move
424
!python {model: stock.move}: |
425
self.action_confirm(cr, uid, [ref('sm_amc5')], context=context)
426
self.action_done(cr, uid, [ref('sm_amc5')], context=context)
428
I create a stock move for product6 to have an AMC different than 0.00
430
!record {model: stock.move, id: sm_amc6}:
432
product_uom: product.product_uom_unit
433
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
434
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
436
location_id: stock.stock_location_stock
437
location_dest_id: stock.stock_location_customers
438
reason_type_id: reason_types_moves.reason_type_deliver_partner
440
name: AMC for product 6
442
I confirm the stock move
444
!python {model: stock.move}: |
445
self.action_confirm(cr, uid, [ref('sm_amc6')], context=context)
446
self.action_done(cr, uid, [ref('sm_amc6')], context=context)
448
I create a stock move for product7 to have an AMC different than 0.00
450
!record {model: stock.move, id: sm_amc7}:
452
product_uom: product.product_uom_unit
453
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
454
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
456
location_id: stock.stock_location_stock
457
location_dest_id: stock.stock_location_customers
458
reason_type_id: reason_types_moves.reason_type_deliver_partner
460
name: AMC for product 7
462
I confirm the stock move
464
!python {model: stock.move}: |
465
self.action_confirm(cr, uid, [ref('sm_amc7')], context=context)
466
self.action_done(cr, uid, [ref('sm_amc7')], context=context)
468
I create a stock move for product8 to have an AMC different than 0.00
470
!record {model: stock.move, id: sm_amc8}:
472
product_uom: product.product_uom_unit
473
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
474
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
476
location_id: stock.stock_location_stock
477
location_dest_id: stock.stock_location_customers
478
reason_type_id: reason_types_moves.reason_type_deliver_partner
480
name: AMC for product 8
482
I confirm the stock move
484
!python {model: stock.move}: |
485
self.action_confirm(cr, uid, [ref('sm_amc8')], context=context)
486
self.action_done(cr, uid, [ref('sm_amc8')], context=context)
488
I create a stock move for product9 to have an AMC different than 0.00
490
!record {model: stock.move, id: sm_amc9}:
492
product_uom: product.product_uom_unit
493
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
494
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
496
location_id: stock.stock_location_stock
497
location_dest_id: stock.stock_location_customers
498
reason_type_id: reason_types_moves.reason_type_deliver_partner
500
name: AMC for product 9
502
I confirm the stock move
504
!python {model: stock.move}: |
505
self.action_confirm(cr, uid, [ref('sm_amc9')], context=context)
506
self.action_done(cr, uid, [ref('sm_amc9')], context=context)
508
I create a stock move for product10 to have an AMC different than 0.00
510
!record {model: stock.move, id: sm_amc10}:
511
product_id: product10
512
product_uom: product.product_uom_unit
513
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
514
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
516
location_id: stock.stock_location_stock
517
location_dest_id: stock.stock_location_customers
518
reason_type_id: reason_types_moves.reason_type_deliver_partner
520
name: AMC for product 10
522
I confirm the stock move
524
!python {model: stock.move}: |
525
self.action_confirm(cr, uid, [ref('sm_amc10')], context=context)
526
self.action_done(cr, uid, [ref('sm_amc10')], context=context)
528
I create a stock move for product11 to have an AMC different than 0.00
530
!record {model: stock.move, id: sm_amc11}:
531
product_id: product11
532
product_uom: product.product_uom_unit
533
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
534
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
536
location_id: stock.stock_location_stock
537
location_dest_id: stock.stock_location_customers
538
reason_type_id: reason_types_moves.reason_type_deliver_partner
540
name: AMC for product 11
542
I confirm the stock move
544
!python {model: stock.move}: |
545
self.action_confirm(cr, uid, [ref('sm_amc11')], context=context)
546
self.action_done(cr, uid, [ref('sm_amc11')], context=context)
548
I create a stock move for product12 to have an AMC different than 0.00
550
!record {model: stock.move, id: sm_amc12}:
551
product_id: product12
552
product_uom: product.product_uom_unit
553
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
554
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
556
location_id: stock.stock_location_stock
557
location_dest_id: stock.stock_location_customers
558
reason_type_id: reason_types_moves.reason_type_deliver_partner
560
name: AMC for product 12
562
I confirm the stock move
564
!python {model: stock.move}: |
565
self.action_confirm(cr, uid, [ref('sm_amc12')], context=context)
566
self.action_done(cr, uid, [ref('sm_amc12')], context=context)
568
I create an inventory
570
!record {model: stock.inventory, id: inv1}:
571
company_id: base.main_company
572
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
573
date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
575
- company_id: base.main_company
576
location_id: stock.stock_location_stock
579
product_uom: product.product_uom_unit
580
- company_id: base.main_company
581
location_id: stock.stock_location_stock
584
product_uom: product.product_uom_unit
585
- company_id: base.main_company
586
location_id: stock.stock_location_stock
589
product_uom: product.product_uom_unit
590
- company_id: base.main_company
591
location_id: stock.stock_location_stock
594
product_uom: product.product_uom_unit
595
- company_id: base.main_company
596
location_id: stock.stock_location_stock
599
product_uom: product.product_uom_unit
600
- company_id: base.main_company
601
location_id: stock.stock_location_stock
604
product_uom: product.product_uom_unit
605
- company_id: base.main_company
606
location_id: stock.stock_location_stock
609
product_uom: product.product_uom_unit
610
- company_id: base.main_company
611
location_id: stock.stock_location_stock
614
product_uom: product.product_uom_unit
615
- company_id: base.main_company
616
location_id: stock.stock_location_stock
619
product_uom: product.product_uom_unit
620
- company_id: base.main_company
621
location_id: stock.stock_location_stock
622
product_id: product10
624
product_uom: product.product_uom_unit
625
- company_id: base.main_company
626
location_id: stock.stock_location_stock
627
product_id: product11
629
product_uom: product.product_uom_unit
630
- company_id: base.main_company
631
location_id: stock.stock_location_stock
632
product_id: product12
634
product_uom: product.product_uom_unit
635
name: Physical inventory
638
I confirm the Inventory
640
!python {model: stock.inventory}: |
641
self.action_confirm(cr,uid,[ref('inv1')])
642
self.action_done(cr,uid,[ref('inv1')])