Launchpad automatic translations update.
[odoo/odoo.git] / addons / stock / test / stock_test.yml
1
2 -
3   In order to test the stock module, I will create product,
4   create physical inventory ,fill inventory lines from location,split inventory line into production lot
5
6 -
7   I create Asset Account Type.
8 -
9   !record {model: account.account.type, id: account_account_type_asset0}:
10     close_method: balance
11     code: asset
12     name: Asset
13     sign: 1
14
15 -
16    I create Income Account Type.
17 -
18   !record {model: account.account.type, id: account_account_type_income0}:
19     close_method: unreconciled
20     code: income
21     name: Income
22     sign: 1
23
24
25 -
26   I create Expense Account Type.
27 -
28   !record {model: account.account.type, id: account_account_type_expense0}:
29     close_method: unreconciled
30     code: expense
31     name: Expense
32     sign: 1
33 -
34   I create Cash Account Type.
35 -
36   !record {model: account.account.type, id: account_account_type_cash0}:
37     close_method: balance
38     code: cash
39     name: Cash
40     sign: 1
41
42
43 -
44   I create Receivable Account Type.
45 -
46   !record {model: account.account.type, id: account_account_type_receivable0}:
47     close_method: balance
48     code: receivable
49     name: Receivable
50     sign: 1
51 -
52
53   I create Receivable Account .
54 -
55   !record {model: account.account, id: account_account_receivable0}:
56     code: '40000-stock-test'
57     company_id: base.main_company
58     currency_mode: current
59     name: Receivable
60     parent_left: 1
61     parent_right: 2
62     type: receivable
63     user_type: account_account_type_receivable0
64 -
65   I create Payable Account.
66 -
67   !record {model: account.account, id: account_account_payable0}:
68     code: '440000-stock-test'
69     company_id: base.main_company
70     currency_mode: current
71     name: Payable
72     parent_left: 3
73     parent_right: 4
74     type: payable
75     user_type: account_account_type_expense0
76 -
77   I create Purchase Journal.
78 -
79   !record {model: account.journal, id: account_journal_purchasejournal0}:
80     code: pur
81     company_id: base.main_company
82     name: Purchase Journal
83     sequence_id:  account.sequence_purchase_journal
84     type: purchase
85     view_id: account.account_journal_bank_view
86
87 -
88   I create Sale Journal.
89 -
90   !record {model: account.journal, id: account_journal_salejouran0}:
91     code: sal
92     company_id: base.main_company
93     name: Sale Journal
94     sequence_id: account.sequence_sale_journal
95     type: sale
96     view_id: account.account_journal_view
97
98 -
99   I create Expense Account.
100 -
101   !record {model: account.account, id: account_account_expenseaccount0}:
102     code: Expe
103     company_id: base.main_company
104     currency_mode: current
105     name: Expense Account
106     parent_left: 5
107     parent_right: 6
108     type: consolidation
109     user_type: account_account_type_asset0
110 -
111   I create Product Sale Account.
112 -
113   !record {model: account.account, id: account_account_productsale0}:
114     code: '001-stock-test'
115     company_id: base.main_company
116     currency_mode: current
117     name: Product Sale
118     type: other
119     user_type: stock.account_account_type_income0
120
121
122 -
123   I create Product Purchase Account.
124 -
125   !record {model: account.account, id: account_account_productpurchase0}:
126     code: '0002-stock-test'
127     company_id: base.main_company
128     currency_mode: current
129     name: Product Purchase
130     type: other
131     user_type: account_account_type_expense0
132
133 -
134   I create partner.
135 -
136   !record {model: res.partner, id: res_partner_shawtrust0}:
137     address:
138       - country_id: base.in
139       - street: St James House, Vicar Lane, Sheffield
140     lang: en_US
141     name: 'Shaw Trust '
142     property_account_payable: account_account_payable0
143     property_account_receivable: account_account_receivable0
144 -
145   I create partner.
146 -
147   !record {model: res.partner, id: res_partner_diasorinltd0}:
148     address:
149       - country_id: base.in
150         street: Ash House, Ash Road
151     name: DiaSorin Ltd
152     supplier: true
153
154
155 -
156   I create partner.
157 -
158   !record {model: res.partner, id: res_partner_microlinktechnologies0}:
159     address:
160       - street: Kailash Vaibhav, Parksite
161     name: Micro Link Technologies
162     property_account_payable: account_account_payable0
163     property_account_receivable: account_account_receivable0
164     supplier: true
165
166 -
167   I create partner address.
168 -
169   !record {model: res.partner.address, id: res_partner_address_0}:
170     country_id: base.in
171     partner_id: stock.res_partner_diasorinltd0
172     street: Ash House, Ash Road
173     title: base.res_partner_title_miss
174
175
176 -
177   I create  product.category .
178 -
179   !record {model: product.category, id: product_category_computer0}:
180     name: Computer
181
182 -
183    I create  product HP Pavilion Desktop PCs .
184 -
185   !record {model: product.product, id: product_product_hppaviliondesktoppcs0}:
186     categ_id: stock.product_category_computer0
187     cost_method: standard
188     mes_type: fixed
189     list_price: 1000.0
190     name: HP Pavilion Desktop PCs
191     procure_method: make_to_stock
192     seller_ids:
193       - delay: 1
194         name: stock.res_partner_shawtrust0
195         min_qty: 5.0
196     supply_method: buy
197     type: product
198     uom_id: product.product_uom_unit
199     uom_po_id: product.product_uom_unit
200     property_account_expense: account_account_productsale0
201     property_account_income: account_account_productsale0
202
203 -
204   I create  product HP CD writers.
205 -
206   !record {model: product.product, id: product_product_hpcdwriters0}:
207     categ_id: stock.product_category_computer0
208     cost_method: standard
209     list_price: 1000.0
210     mes_type: fixed
211     name: HP CD writers
212     procure_method: make_to_stock
213     seller_ids:
214       - delay: 1
215         name: res_partner_shawtrust0
216         min_qty: 5.0
217     supply_method: buy
218     type: product
219     uom_id: product.product_uom_unit
220     uom_po_id: product.product_uom_unit
221     property_account_expense: account_account_productpurchase0
222     property_account_income: account_account_productsale0
223
224 -
225   I create Physical Inventory for the products.
226 -
227    !record {model: stock.inventory, id: stock_inventory_physicalinventoy0}:
228     company_id: base.main_company
229     date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
230     date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
231     inventory_line_id:
232       - company_id: base.main_company
233         location_id: stock.stock_location_stock
234         product_id: stock.product_product_hpcdwriters0
235         product_qty: 10.0
236         product_uom: product.product_uom_unit
237       - company_id: base.main_company
238         location_id: stock.stock_location_stock
239         product_id: stock.product_product_hppaviliondesktoppcs0
240         product_qty: 10.0
241         product_uom: product.product_uom_unit
242     name: Physical inventory
243     state: draft
244
245
246 -
247   I confirm the Inventory for HP CD writers.
248 -
249   !python {model: stock.inventory}: |
250    self.action_confirm(cr,uid,[ref('stock_inventory_physicalinventoy0')])
251    self.action_done(cr,uid,[ref('stock_inventory_physicalinventoy0')])
252 -
253   I create stock.fill.inventory .
254 -
255   !record {model: stock.fill.inventory, id: stock_fill_inventory_0}:
256     location_id: stock.stock_location_stock
257
258 -
259   I fill inventory for HP CD writers.
260 -
261   !python {model: stock.fill.inventory}: |
262     self.fill_inventory(cr, uid, [ref("stock_fill_inventory_0")], {"lang": 'en_US',
263       "full": "1", "tz": False, "active_model": "stock.inventory", "active_ids":
264       [ref("stock_inventory_physicalinventoy0")], "active_id": ref("stock_inventory_physicalinventoy0"), })
265
266 -
267   I create stock.move.split record.
268 -
269   !record {model: stock.move.split, id: stock_move_split_0}:
270     line_ids:
271       - name: '00001-stock-test'
272         quantity: 5
273     product_id: stock.product_product_hpcdwriters0
274
275 -
276   I Split into production line.
277 -
278   !python {model: stock.move.split}: |
279     move_obj=self.pool.get('stock.move')
280     product_obj=self.pool.get('product.product')
281     product_id=product_obj.search(cr,uid,[('name','=','HP CD writers')])
282     move_ids=move_obj.search(cr,uid,[('product_id','in',product_id)])
283     self.split_lot(cr, uid, [ref("stock_move_split_0")], {"lang": 'en_US', "active_model":
284       "stock.move", "active_ids": move_ids, "tz": False, "active_id":move_ids[0]
285       })
286 -
287
288   In Order to test the picking I create picking with move lines.
289 -
290   !record {model: stock.picking, id: stock_picking_0}:
291     name: test_picking
292     address_id: base.res_partner_address_4
293     company_id: base.main_company
294     date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
295     invoice_state: none
296     move_lines:
297       - company_id: base.main_company
298         date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
299         location_dest_id: stock.stock_location_customers
300         location_id: stock.stock_location_stock
301         name: HP CD writers
302         product_id: product.product_product_pc1
303         product_qty: 3.0
304         product_uom: product.product_uom_unit
305         date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
306         product_uos_qty: 3.0
307     move_type: direct
308     type: internal
309
310
311 -
312   I click on draft_force_assign on picking.
313 -
314   !python {model: stock.picking}: |
315     self.draft_force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model":
316       "ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display":
317       "partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id":
318       ref("stock.menu_action_picking_tree6"), })
319
320
321 -
322   I click on force_assign on picking.
323 -
324   !python {model: stock.picking}: |
325     self.force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model":
326       "ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display":
327       "partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id":
328       ref("stock.menu_action_picking_tree6"), })
329
330 -
331   I confirm the picking.
332 -
333   !python {model: stock.picking }: |
334    import time
335    pick=self.browse(cr,uid,ref('stock_picking_0'))
336    move =pick.move_lines[0]
337    partial_datas = {
338           'partner_id':pick.address_id.partner_id.id,
339            'address_id': pick.address_id.id,
340            'delivery_date' : time.strftime('%Y-%m-%d')
341             }
342    partial_datas['move%s'%(move.id)]= {
343           'product_id': move.product_id,
344           'product_qty': move.product_qty,
345           'product_uom': move.product_uom.id,
346       }
347    self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)