~openerp/openobject-addons/6.0-search-account-journal-view-using-xml_id-instead-of-name-olt

« back to all changes in this revision

Viewing changes to stock/test/stock_test.yml

  • Committer: qdp-launchpad at tinyerp
  • Date: 2011-01-14 00:11:01 UTC
  • mfrom: (3164.118.723 dev-3addons)
  • Revision ID: qdp-launchpad@tinyerp.com-20110114001101-wk77opsrvslh7pak
Tags: openerp-buildfail-1-5165
[MERGE] merged the dev3 branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
-
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
5
 
     
6
 
 
5
 
 
6
-
7
7
  I create Asset Account Type.
8
 
 
8
-
9
9
  !record {model: account.account.type, id: account_account_type_asset0}:
10
10
    close_method: balance
11
11
    code: asset
12
12
    name: Asset
13
13
    sign: 1
14
 
    
15
 
 
14
 
 
15
-
16
16
   I create Income Account Type.
17
 
 
17
-
18
18
  !record {model: account.account.type, id: account_account_type_income0}:
19
19
    close_method: unreconciled
20
20
    code: income
21
21
    name: Income
22
22
    sign: 1
23
 
    
24
 
    
25
 
 
23
 
 
24
 
 
25
-
26
26
  I create Expense Account Type.
27
 
 
27
-
28
28
  !record {model: account.account.type, id: account_account_type_expense0}:
29
29
    close_method: unreconciled
30
30
    code: expense
31
31
    name: Expense
32
 
    sign: 1    
33
 
 
32
    sign: 1
 
33
-
34
34
  I create Cash Account Type.
35
 
 
35
-
36
36
  !record {model: account.account.type, id: account_account_type_cash0}:
37
37
    close_method: balance
38
38
    code: cash
39
39
    name: Cash
40
40
    sign: 1
41
 
    
42
 
    
43
 
 
41
 
 
42
 
 
43
-
44
44
  I create Receivable Account Type.
45
 
 
45
-
46
46
  !record {model: account.account.type, id: account_account_type_receivable0}:
47
47
    close_method: balance
48
48
    code: receivable
49
49
    name: Receivable
50
50
    sign: 1
51
51
-
52
 
 
 
52
 
53
53
  I create Receivable Account .
54
 
 
54
-
55
55
  !record {model: account.account, id: account_account_receivable0}:
56
56
    code: '40000-stock-test'
57
57
    company_id: base.main_company
61
61
    parent_right: 2
62
62
    type: receivable
63
63
    user_type: account_account_type_receivable0
64
 
 
64
-
65
65
  I create Payable Account.
66
 
 
66
-
67
67
  !record {model: account.account, id: account_account_payable0}:
68
68
    code: '440000-stock-test'
69
69
    company_id: base.main_company
72
72
    parent_left: 3
73
73
    parent_right: 4
74
74
    type: payable
75
 
    user_type: account_account_type_expense0    
76
 
 
75
    user_type: account_account_type_expense0
 
76
-
77
77
  I create Purchase Journal.
78
 
 
78
-
79
79
  !record {model: account.journal, id: account_journal_purchasejournal0}:
80
80
    code: pur
81
81
    company_id: base.main_company
83
83
    sequence_id:  account.sequence_purchase_journal
84
84
    type: purchase
85
85
    view_id: account.account_journal_bank_view
86
 
    
87
 
 
86
 
 
87
-
88
88
  I create Sale Journal.
89
 
 
89
-
90
90
  !record {model: account.journal, id: account_journal_salejouran0}:
91
91
    code: sal
92
92
    company_id: base.main_company
94
94
    sequence_id: account.sequence_sale_journal
95
95
    type: sale
96
96
    view_id: account.account_journal_view
97
 
    
98
 
 
97
 
 
98
-
99
99
  I create Expense Account.
100
 
 
100
-
101
101
  !record {model: account.account, id: account_account_expenseaccount0}:
102
102
    code: Expe
103
103
    company_id: base.main_company
107
107
    parent_right: 6
108
108
    type: consolidation
109
109
    user_type: account_account_type_asset0
110
 
 
110
-
111
111
  I create Product Sale Account.
112
 
 
112
-
113
113
  !record {model: account.account, id: account_account_productsale0}:
114
114
    code: '001-stock-test'
115
115
    company_id: base.main_company
117
117
    name: Product Sale
118
118
    type: other
119
119
    user_type: stock.account_account_type_income0
120
 
    
121
 
    
122
 
 
120
 
 
121
 
 
122
-
123
123
  I create Product Purchase Account.
124
 
 
124
-
125
125
  !record {model: account.account, id: account_account_productpurchase0}:
126
126
    code: '0002-stock-test'
127
127
    company_id: base.main_company
129
129
    name: Product Purchase
130
130
    type: other
131
131
    user_type: account_account_type_expense0
132
 
        
133
 
 
132
 
 
133
-
134
134
  I create partner.
135
 
 
135
-
136
136
  !record {model: res.partner, id: res_partner_shawtrust0}:
137
137
    address:
138
 
      - country_id: base.in    
 
138
      - country_id: base.in
139
139
      - street: St James House, Vicar Lane, Sheffield
140
140
    lang: en_US
141
141
    name: 'Shaw Trust '
142
142
    property_account_payable: account_account_payable0
143
143
    property_account_receivable: account_account_receivable0
144
 
-    
 
144
-
145
145
  I create partner.
146
 
 
146
-
147
147
  !record {model: res.partner, id: res_partner_diasorinltd0}:
148
148
    address:
149
149
      - country_id: base.in
150
150
        street: Ash House, Ash Road
151
151
    name: DiaSorin Ltd
152
152
    supplier: true
153
 
    
154
 
        
 
153
 
 
154
 
155
155
-
156
156
  I create partner.
157
 
 
157
-
158
158
  !record {model: res.partner, id: res_partner_microlinktechnologies0}:
159
159
    address:
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   
164
 
    supplier: true        
165
 
    
 
163
    property_account_receivable: account_account_receivable0
 
164
    supplier: true
 
165
 
166
166
-
167
167
  I create partner address.
168
 
 
168
-
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
174
 
    
175
 
               
176
 
-     
 
174
 
 
175
 
 
176
-
177
177
  I create  product.category .
178
 
 
178
-
179
179
  !record {model: product.category, id: product_category_computer0}:
180
180
    name: Computer
181
181
 
182
 
 
182
-
183
183
   I create  product HP Pavilion Desktop PCs .
184
 
 
184
-
185
185
  !record {model: product.product, id: product_product_hppaviliondesktoppcs0}:
186
186
    categ_id: stock.product_category_computer0
187
187
    cost_method: standard
188
188
    mes_type: fixed
189
 
    list_price: 1000.0    
 
189
    list_price: 1000.0
190
190
    name: HP Pavilion Desktop PCs
191
191
    procure_method: make_to_stock
192
192
    seller_ids:
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    
202
 
    
203
 
 
201
    property_account_income: account_account_productsale0
 
202
 
 
203
-
204
204
  I create  product HP CD writers.
205
 
 
205
-
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
223
 
    
224
 
 
223
 
 
224
-
225
225
  I create Physical Inventory for the products.
226
 
-  
227
 
   !record {model: stock.inventory, id: stock_inventory_physicalinventoy0}:  
 
226
-
 
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
243
243
    state: draft
244
 
    
245
 
 
246
 
 
244
 
 
245
 
 
246
-
247
247
  I confirm the Inventory for HP CD writers.
248
 
 
248
-
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')])
252
 
 
252
-
253
253
  I create stock.fill.inventory .
254
 
 
254
-
255
255
  !record {model: stock.fill.inventory, id: stock_fill_inventory_0}:
256
256
    location_id: stock.stock_location_stock
257
 
       
258
 
 
257
 
 
258
-
259
259
  I fill inventory for HP CD writers.
260
 
 
260
-
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"), })
265
265
 
266
 
 
266
-
267
267
  I create stock.move.split record.
268
 
 
268
-
269
269
  !record {model: stock.move.split, id: stock_move_split_0}:
270
270
    line_ids:
271
271
      - name: '00001-stock-test'
272
 
        quantity: 5      
 
272
        quantity: 5
273
273
    product_id: stock.product_product_hpcdwriters0
274
 
     
275
 
 
274
 
 
275
-
276
276
  I Split into production line.
277
 
 
277
-
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]
285
285
      })
286
286
-
287
 
 
 
287
 
288
288
  In Order to test the picking I create picking with move lines.
289
 
 
289
-
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
296
296
    move_lines:
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
303
303
        product_qty: 3.0
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
308
308
    type: internal
309
 
    
310
 
    
311
 
 
309
 
 
310
 
 
311
-
312
312
  I click on draft_force_assign on picking.
313
 
 
313
-
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"), })
319
 
    
320
 
    
321
 
 
319
 
 
320
 
 
321
-
322
322
  I click on force_assign on picking.
323
 
 
323
-
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"), })
329
 
    
 
329
 
330
330
-
331
331
  I confirm the picking.
332
 
-  
 
332
-
333
333
  !python {model: stock.picking }: |
334
334
   import time
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,
346
 
      } 
 
346
      }
347
347
   self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)