3
Creating a res.partner record
5
!record {model: res.partner, id: res_partner_a0}:
12
Creating a res.partner.address record
14
!record {model: res.partner.address, id: res_partner_address_0}:
15
partner_id: res_partner_a0
19
Creating a res.partner record
21
!record {model: res.partner, id: res_partner_b0}:
28
Creating a res.partner.address record
30
!record {model: res.partner.address, id: res_partner_address_1}:
31
partner_id: res_partner_b0
35
Creating a product.product record
37
!record {model: product.product, id: product_product_p0}:
39
valuation: manual_periodic
44
categ_id: product.cat0
48
procure_method: make_to_stock
52
uom_id: product.product_uom_unit
53
uom_po_id: product.product_uom_unit
57
I create the locations and warehouse
60
!record {model: stock.location, id: stock_location_0}:
62
location_category: stock
66
I create the locations and warehouse
70
!record {model: stock.location, id: stock_location_1}:
72
location_category: stock
76
I create the locations and warehouse
80
!record {model: stock.location, id: stock_location_2}:
82
location_category: stock
86
I create the locations and warehouse
90
!record {model: stock.warehouse, id: stock_warehouse_0}:
92
lot_input_id: stock_location_0
93
lot_stock_id: stock_location_1
94
lot_output_id: stock_location_2
98
I create the order point, with stock as location
102
!record {model: stock.warehouse.orderpoint, id: orderpoint_0}:
104
warehouse_id: stock_warehouse_0
105
product_id: product_product_p0
106
product_uom: product.product_uom_unit
107
location_id: stock_location_1
109
product_max_qty: 1000
119
!function {model: procurement.order, name: run_scheduler}:
120
- model: procurement.order
125
Test the procurement locatino
130
!python {model: procurement.order}: |
132
# look for the procurement corresponding to the created product, must be in exception
133
pro_ids = self.search(cr, uid, [('product_id', '=', ref("product_product_p0"))], context=context)
135
assert self.browse(cr, uid, pro_ids[0], context=context).location_id.id == ref("stock_location_0"), 'location of procurement is wrong, found %i, should be %i'%(self.browse(cr, uid, pro_ids[0], context=context).location_id.id,ref("stock_location_0"))