~ajite/openobject-addons/elico-7.0-add-0003

« back to all changes in this revision

Viewing changes to wms/test/wms_test02.yml

  • Committer:
  • Date: 2014-02-15 09:00:31 UTC
  • Revision ID: elicoidal@hotmail.com-20140215090031-zck4q099ih5jybru
[ADD] wms for 7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-
 
2
    2. Test name
 
3
-
 
4
    # Create the warehouse
 
5
    !record {model: stock.warehouse, id: wms_stock_warehouse_test2}:
 
6
        name: WMS Test 2
 
7
        lot_input_id: stock.stock_location_stock
 
8
        lot_output_id: stock.stock_location_output
 
9
        lot_stock_id: stock.stock_location_stock
 
10
        force_reserve: True
 
11
-
 
12
    # Create the first location
 
13
    !record {model: stock.location, id: wms_stock_location_test2_location1}:
 
14
        name: 'WMS Test 2 - Location 1'
 
15
        warehouse_id: wms_stock_warehouse_test2
 
16
-
 
17
    # Create the second location
 
18
    !record {model: stock.location, id: wms_stock_location_test2_location2}:
 
19
        name: 'WMS Test 2 - Location 2'
 
20
        warehouse_id: wms_stock_warehouse_test2
 
21
        categ_id: wms.stock_location_cat_crossdock
 
22
-
 
23
    # Put the crossdock location on the warehouse
 
24
    !record {model: stock.warehouse, id: wms_stock_warehouse_test2}:
 
25
        crossdock_location_id: wms_stock_location_test2_location2
 
26
-
 
27
    # Create the product
 
28
    !record {model: product.product, id: wms_product_product_test2}:
 
29
        name: WMS Test 2
 
30
-
 
31
    # Create the picking out
 
32
    !record {model: stock.picking, id: wms_stock_picking_test2_picking_out}:
 
33
        name: 'WMS Test 2 - Picking out'
 
34
        type: out
 
35
        partner_id: base.main_partner
 
36
        address_id: base.main_address
 
37
-
 
38
    # Create the move in the picking out
 
39
    !record {model: stock.move, id: wms_stock_move_test2_move_out}:
 
40
        name: 'WMS Test 2 - Move out'
 
41
        date: '2011-06-30 00:00:00'
 
42
        picking_id: wms_stock_picking_test2_picking_out
 
43
        product_id: wms_product_product_test2
 
44
        product_uom: product.product_uom_unit
 
45
        product_qty: 1
 
46
        location_id: wms_stock_location_test2_location1
 
47
        location_dest_id: wms_stock_location_test2_location1
 
48
-
 
49
    # Create the picking in
 
50
    !record {model: stock.picking, id: wms_stock_picking_test2_picking_in}:
 
51
        name: 'WMS Test 2 - Picking in'
 
52
        type: in
 
53
        partner_id: base.main_partner
 
54
        address_id: base.main_address
 
55
-
 
56
    # Create the move in the picking in
 
57
    !record {model: stock.move, id: wms_stock_move_test2_move_in}:
 
58
        name: 'WMS Test 2 - Move in'
 
59
        picking_id: wms_stock_picking_test2_picking_in
 
60
        product_id: wms_product_product_test2
 
61
        product_uom: product.product_uom_unit
 
62
        product_qty: 1
 
63
        location_id: wms_stock_location_test2_location1
 
64
        location_dest_id: wms_stock_location_test2_location1
 
65
-
 
66
    # Confirm the picking out
 
67
    !workflow {model: stock.picking, action: button_confirm, ref: wms_stock_picking_test2_picking_out}
 
68
-
 
69
    # Confirm the picking in
 
70
    !workflow {model: stock.picking, action: button_confirm, ref: wms_stock_picking_test2_picking_in}
 
71
-
 
72
    # Check availability
 
73
    !function {model: stock.picking, name: action_assign}:
 
74
        - [!ref {model: stock.picking, id: wms_stock_picking_test2_picking_in}]
 
75
-
 
76
    # Start the wizard to receipt products
 
77
    !record {model: stock.partial.picking, id: wms_stock_partial_picking_test2}:
 
78
        date: '2011-06-29 00:00:00'
 
79
        product_moves_in:
 
80
            -
 
81
                product_id: wms_product_product_test2
 
82
                quantity: 1
 
83
                product_uom: product.product_uom_unit
 
84
                move_id: wms_stock_move_test2_move_in
 
85
        product_moves_out:
 
86
            -
 
87
                product_id: wms_product_product_test2
 
88
                quantity: 1
 
89
                product_uom: product.product_uom_unit
 
90
                move_id: wms_stock_move_test2_move_in
 
91
-
 
92
    # Receipt the products
 
93
    !function {model: stock.partial.picking, name: do_partial}:
 
94
        - [!ref {model: stock.partial.picking, id: wms_stock_partial_picking_test2}]
 
95
        - eval: "{'active_ids': [ref(\"wms_stock_picking_test2_picking_in\")], 'active_id': ref(\"wms_stock_picking_test2_picking_in\")}"
 
96
-
 
97
    # Check the move out
 
98
    !assert {model: stock.move, id: wms_stock_move_test2_move_out, string: Quantity on move out}:
 
99
        - product_qty == 1
 
100
        - location_id.id == ref('wms_stock_location_test2_location1')
 
101
-
 
102
    # Check the move in
 
103
    !assert {model: stock.move, id: wms_stock_move_test2_move_in, string: Quantity on move in}:
 
104
        - product_qty == 1
 
105
        - location_dest_id.id == ref('wms_stock_location_test2_location1')
 
106
        - move_dest_id.id == False
 
107
-
 
108
    # Check the lines number of the picking out
 
109
    !assert {model: stock.picking, id: wms_stock_picking_test2_picking_out, string: Number of out moves}:
 
110
        - len(move_lines) == 1
 
111
-
 
112
    # Check the lines number of the picking in
 
113
    !assert {model: stock.picking, id: wms_stock_picking_test2_picking_in, string: Number of in moves}:
 
114
        - len(move_lines) == 1
 
115