3
3
In order to test the stock module, I will create product,
4
4
create physical inventory ,fill inventory lines from location,split inventory line into production lot
7
7
I create Asset Account Type.
9
9
!record {model: account.account.type, id: account_account_type_asset0}:
10
10
close_method: balance
16
16
I create Income Account Type.
18
18
!record {model: account.account.type, id: account_account_type_income0}:
19
19
close_method: unreconciled
26
26
I create Expense Account Type.
28
28
!record {model: account.account.type, id: account_account_type_expense0}:
29
29
close_method: unreconciled
34
34
I create Cash Account Type.
36
36
!record {model: account.account.type, id: account_account_type_cash0}:
37
37
close_method: balance
44
44
I create Receivable Account Type.
46
46
!record {model: account.account.type, id: account_account_type_receivable0}:
47
47
close_method: balance
53
53
I create Receivable Account .
55
55
!record {model: account.account, id: account_account_receivable0}:
56
56
code: '40000-stock-test'
57
57
company_id: base.main_company
63
63
user_type: account_account_type_receivable0
65
65
I create Payable Account.
67
67
!record {model: account.account, id: account_account_payable0}:
68
68
code: '440000-stock-test'
69
69
company_id: base.main_company
75
user_type: account_account_type_expense0
75
user_type: account_account_type_expense0
77
77
I create Purchase Journal.
79
79
!record {model: account.journal, id: account_journal_purchasejournal0}:
81
81
company_id: base.main_company
94
94
sequence_id: account.sequence_sale_journal
96
96
view_id: account.account_journal_view
99
99
I create Expense Account.
101
101
!record {model: account.account, id: account_account_expenseaccount0}:
103
103
company_id: base.main_company
129
129
name: Product Purchase
131
131
user_type: account_account_type_expense0
134
134
I create partner.
136
136
!record {model: res.partner, id: res_partner_shawtrust0}:
138
- country_id: base.in
138
- country_id: base.in
139
139
- street: St James House, Vicar Lane, Sheffield
141
141
name: 'Shaw Trust '
142
142
property_account_payable: account_account_payable0
143
143
property_account_receivable: account_account_receivable0
145
145
I create partner.
147
147
!record {model: res.partner, id: res_partner_diasorinltd0}:
149
149
- country_id: base.in
150
150
street: Ash House, Ash Road
151
151
name: DiaSorin Ltd
156
156
I create partner.
158
158
!record {model: res.partner, id: res_partner_microlinktechnologies0}:
160
160
- street: Kailash Vaibhav, Parksite
161
161
name: Micro Link Technologies
162
162
property_account_payable: account_account_payable0
163
property_account_receivable: account_account_receivable0
163
property_account_receivable: account_account_receivable0
167
167
I create partner address.
169
169
!record {model: res.partner.address, id: res_partner_address_0}:
170
170
country_id: base.in
171
171
partner_id: stock.res_partner_diasorinltd0
172
172
street: Ash House, Ash Road
173
173
title: base.res_partner_title_miss
177
177
I create product.category .
179
179
!record {model: product.category, id: product_category_computer0}:
183
183
I create product HP Pavilion Desktop PCs .
185
185
!record {model: product.product, id: product_product_hppaviliondesktoppcs0}:
186
186
categ_id: stock.product_category_computer0
187
187
cost_method: standard
190
190
name: HP Pavilion Desktop PCs
191
191
procure_method: make_to_stock
198
198
uom_id: product.product_uom_unit
199
199
uom_po_id: product.product_uom_unit
200
200
property_account_expense: account_account_productsale0
201
property_account_income: account_account_productsale0
201
property_account_income: account_account_productsale0
204
204
I create product HP CD writers.
206
206
!record {model: product.product, id: product_product_hpcdwriters0}:
207
207
categ_id: stock.product_category_computer0
208
208
cost_method: standard
220
220
uom_po_id: product.product_uom_unit
221
221
property_account_expense: account_account_productpurchase0
222
222
property_account_income: account_account_productsale0
225
225
I create Physical Inventory for the products.
227
!record {model: stock.inventory, id: stock_inventory_physicalinventoy0}:
227
!record {model: stock.inventory, id: stock_inventory_physicalinventoy0}:
228
228
company_id: base.main_company
229
date: '2010-05-10 18:19:13'
230
date_done: '2010-05-10 18:19:59'
229
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
230
date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
231
231
inventory_line_id:
232
232
- company_id: base.main_company
233
233
location_id: stock.stock_location_stock
241
241
product_uom: product.product_uom_unit
242
242
name: Physical inventory
247
247
I confirm the Inventory for HP CD writers.
249
249
!python {model: stock.inventory}: |
250
250
self.action_confirm(cr,uid,[ref('stock_inventory_physicalinventoy0')])
251
251
self.action_done(cr,uid,[ref('stock_inventory_physicalinventoy0')])
253
253
I create stock.fill.inventory .
255
255
!record {model: stock.fill.inventory, id: stock_fill_inventory_0}:
256
256
location_id: stock.stock_location_stock
259
259
I fill inventory for HP CD writers.
261
261
!python {model: stock.fill.inventory}: |
262
262
self.fill_inventory(cr, uid, [ref("stock_fill_inventory_0")], {"lang": 'en_US',
263
263
"full": "1", "tz": False, "active_model": "stock.inventory", "active_ids":
264
264
[ref("stock_inventory_physicalinventoy0")], "active_id": ref("stock_inventory_physicalinventoy0"), })
267
267
I create stock.move.split record.
269
269
!record {model: stock.move.split, id: stock_move_split_0}:
271
271
- name: '00001-stock-test'
273
273
product_id: stock.product_product_hpcdwriters0
276
276
I Split into production line.
278
278
!python {model: stock.move.split}: |
279
279
move_obj=self.pool.get('stock.move')
280
280
product_obj=self.pool.get('product.product')
284
284
"stock.move", "active_ids": move_ids, "tz": False, "active_id":move_ids[0]
288
288
In Order to test the picking I create picking with move lines.
290
290
!record {model: stock.picking, id: stock_picking_0}:
291
291
name: test_picking
292
292
address_id: base.res_partner_address_4
293
293
company_id: base.main_company
294
date: '2010-05-11 15:18:52'
294
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
295
295
invoice_state: none
297
297
- company_id: base.main_company
298
date: '2010-05-11 15:18:57'
298
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
299
299
location_dest_id: stock.stock_location_customers
300
300
location_id: stock.stock_location_stock
301
301
name: HP CD writers
302
302
product_id: product.product_product_pc1
304
304
product_uom: product.product_uom_unit
305
date: '2010-05-11 15:18:57'
305
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
306
306
product_uos_qty: 3.0
307
307
move_type: direct
312
312
I click on draft_force_assign on picking.
314
314
!python {model: stock.picking}: |
315
315
self.draft_force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model":
316
316
"ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display":
317
317
"partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id":
318
318
ref("stock.menu_action_picking_tree6"), })
322
322
I click on force_assign on picking.
324
324
!python {model: stock.picking}: |
325
325
self.force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model":
326
326
"ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display":
327
327
"partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id":
328
328
ref("stock.menu_action_picking_tree6"), })
331
331
I confirm the picking.
333
333
!python {model: stock.picking }: |
335
335
pick=self.browse(cr,uid,ref('stock_picking_0'))
343
343
'product_id': move.product_id,
344
344
'product_qty': move.product_qty,
345
345
'product_uom': move.product_uom.id,
347
347
self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)