~unifield-team/unifield-wm/us-671-homere

« back to all changes in this revision

Viewing changes to analytic_distribution/test/analytic_data.yml

  • Committer: jf
  • Date: 2012-04-17 15:29:16 UTC
  • mfrom: (631.3.7 UF_828)
  • Revision ID: jf@tempo4-20120417152916-svm6ioq8ur2bi5tu
UF-955 [DEV] Reporting (Month-end) - 2 remaining reports
lp:~unifield-team/unifield-wm/UF_955

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
-
2
 
  I create an analytic Correction Journal
3
 
-
4
 
  !record {model: account.analytic.journal, id: analytic_journal_correction}:
5
 
    name: Analytic Correction Journal
6
 
    code: ACOR
7
 
    type: correction
8
 
-
9
 
  I create an Expense Account Type.
10
 
-
11
 
  !record {model: account.account.type, id: account_account_type_expense0}:
12
 
    close_method: unreconciled
13
 
    code: expense
14
 
    name: Expense
15
 
    sign: 1
16
 
-
17
 
  I create a 6101 Expense Account.
18
 
-
19
 
  !record {model: account.account, id: account_account_expense0}:
20
 
    code: '6101-expense-test'
21
 
    company_id: base.main_company
22
 
    currency_mode: current
23
 
    name: Expense Account
24
 
    type: other
25
 
    user_type: account_account_type_expense0
26
 
    activation_date: !eval datetime.today().strftime('%Y-01-01')
27
 
    default_destination_id: analytic_distribution.analytic_account_destination_operation
28
 
    destination_ids: [analytic_distribution.analytic_account_destination_operation, analytic_distribution.analytic_account_destination_support]
29
 
-
30
 
  I create a 6102 Expense Account.
31
 
-
32
 
  !record {model: account.account, id: account_6102}:
33
 
    code: '6102-expense-test'
34
 
    company_id: base.main_company
35
 
    currency_mode: current
36
 
    name: Expense Account
37
 
    type: other
38
 
    user_type: account_account_type_expense0
39
 
    activation_date: !eval datetime.today().strftime('%Y-01-01')
40
 
    default_destination_id: analytic_distribution.analytic_account_destination_operation
41
 
    destination_ids: [analytic_distribution.analytic_account_destination_operation, analytic_distribution.analytic_account_destination_support]
42
 
-
43
 
  I create a link between 6101 expense account and Operation destination
44
 
-
45
 
  !record {model: account.destination.link, id: tuple_operation_6101}:
46
 
    account_id: account_account_expense0
47
 
    destination_id: analytic_distribution.analytic_account_destination_operation
48
 
-
49
 
  I create a link between 6101 expense account and Support destination
50
 
-
51
 
  !record {model: account.destination.link, id: tuple_support_6101}:
52
 
    account_id: account_account_expense0
53
 
    destination_id: analytic_distribution.analytic_account_destination_support
54
 
-
55
 
  I create a link between 6102 expense account and Operation destination
56
 
-
57
 
  !record {model: account.destination.link, id: tuple_operation_6102}:
58
 
    account_id: account_account_expense0
59
 
    destination_id: analytic_distribution.analytic_account_destination_operation
60
 
-
61
 
  I create a link between 6102 expense account and Support destination
62
 
-
63
 
  !record {model: account.destination.link, id: tuple_support_6102}:
64
 
    account_id: account_account_expense0
65
 
    destination_id: analytic_distribution.analytic_account_destination_support
66
 
-
67
2
  I create an analytic account attached to OC (Operation Center) named Gabon
68
3
-
69
4
  !record {model: account.analytic.account, id: analytic_account_gabon}:
75
10
    parent_id: analytic_distribution.analytic_account_project
76
11
    date: !eval "'%s-01-01' %(datetime.now().year + 2)"
77
12
-
78
 
  I create a CC analytic account attached to OC (Operation Center)
 
13
  I create an analytic account attached to OC (Operation Center) named Kenya
79
14
-
80
 
  !record {model: account.analytic.account, id: analytic_cc}:
81
 
    name: "CC"
 
15
  !record {model: account.analytic.account, id: analytic_account_kenya}:
 
16
    name: "Kenya"
82
17
    currency_id: 1
83
 
    code: CC
 
18
    code: KEN
84
19
    type: normal
85
20
    category: OC
86
21
    parent_id: analytic_distribution.analytic_account_project
87
22
    date: !eval "'%s-01-01' %(datetime.now().year + 2)"
88
23
-
89
 
  I create an FP analytic account named Gabon Hospital attached to Gabon CC
90
 
-
91
 
  !record {model: account.analytic.account, id: analytic_account_fp_gabon_hospital}:
92
 
    name: "Gabon Hospital"
93
 
    currency_id: 1
94
 
    code: GABH
95
 
    type: normal
96
 
    category: FUNDING
97
 
    parent_id: analytic_distribution.analytic_account_funding_pool
98
 
    date: !eval "'%s-01-01' %(datetime.now().year + 2)"
99
 
    cost_center_ids: [analytic_account_gabon]
100
 
    tuple_destination_account_ids: [tuple_operation_6101, tuple_operation_6102]
101
 
-
102
 
  I create an FP analytic account named Kenya AIDS attached to Kenya CC
103
 
-
104
 
  !record {model: account.analytic.account, id: analytic_account_fp_kenya_aids}:
105
 
    name: "Kenya AIDS"
106
 
    currency_id: 1
107
 
    code: KENA
108
 
    type: normal
109
 
    category: FUNDING
110
 
    parent_id: analytic_distribution.analytic_account_funding_pool
111
 
    date: !eval "'%s-01-01' %(datetime.now().year + 2)"
112
 
    cost_center_ids: [analytic_cc]
113
 
    tuple_destination_account_ids: [tuple_support_6101, tuple_support_6102]
114
 
-
115
24
  I create a global analytical distribution
116
25
-
117
26
  !record {model: analytic.distribution, id: global_distrib_1}:
126
35
    currency_id: 1
127
36
    analytic_id: analytic_account_gabon
128
37
    distribution_id: global_distrib_1
129
 
    destination_id: analytic_distribution.analytic_account_destination_operation
130
38
-
131
39
  I create a cost center distribution line for kenya
132
40
-
135
43
    amount: 0.0
136
44
    percentage: 25.0
137
45
    currency_id: 1
138
 
    analytic_id: analytic_cc
 
46
    analytic_id: analytic_account_kenya
139
47
    distribution_id: global_distrib_1
140
 
    destination_id: analytic_distribution.analytic_account_destination_support
141
48
-
142
49
  I create a funding pool distribution line for gabon
143
50
-
146
53
    amount: 0.0
147
54
    percentage: 75.0
148
55
    currency_id: 1
149
 
    analytic_id: analytic_account_fp_gabon_hospital
 
56
    analytic_id: analytic_account_gabon
150
57
    distribution_id: global_distrib_1
151
 
    cost_center_id: analytic_account_gabon
152
 
    destination_id: analytic_distribution.analytic_account_destination_operation
153
58
-
154
59
  I create a funding pool distribution line for kenya
155
60
-
158
63
    amount: 0.0
159
64
    percentage: 25.0
160
65
    currency_id: 1
161
 
    analytic_id: analytic_account_fp_kenya_aids
162
 
    cost_center_id: analytic_cc
163
 
    destination_id: analytic_distribution.analytic_account_destination_support
 
66
    analytic_id: analytic_account_kenya
164
67
    distribution_id: global_distrib_1
165
 
-
166
 
  I create a fiscalyear
167
 
-
168
 
  !record {model: account.fiscalyear, id: fiscalyear0}:
169
 
    code: !eval "'FY%s'% (datetime.now().year+10)"
170
 
    company_id: base.main_company
171
 
    date_start: !eval "'%s-01-01' %(datetime.now().year+10)"
172
 
    date_stop: !eval "'%s-12-31' %(datetime.now().year+10)"
173
 
    name: !eval "'Fiscal Year %s' %(datetime.now().year+10)"
174
 
-
175
 
  I create the period 1
176
 
-
177
 
  !record {model: account.period, id: period1}:
178
 
    company_id: base.main_company
179
 
    date_start: !eval time.strftime('%Y-%m-01')
180
 
    date_stop: !eval (DateTime.now()+DateTime.RelativeDateTime(day=-1,years=10)).strftime('%Y-%m-%d')
181
 
    fiscalyear_id: fiscalyear0
182
 
    name: JAN-HHHHH-OP
183
 
    special: 1
184
 
-
185
 
  I create a Receivable Account Type.
186
 
-
187
 
  !record {model: account.account.type, id: account_account_type_receivable0}:
188
 
    close_method: balance
189
 
    code: receivable
190
 
    name: Receivable
191
 
    sign: 1
192
 
-
193
 
  I create an Analytic Expenses Journal.
194
 
-
195
 
  !record {model: account.analytic.journal, id: account_analytic_journal_expenses_0}:
196
 
    code: expense
197
 
    company_id: base.main_company
198
 
    name: Analytic Expenses Journal (test)
199
 
    type: purchase
200
 
-
201
 
  I create an Expenses Journal.
202
 
-
203
 
  !record {model: account.journal, id: account_journal_expenses_0}:
204
 
    code: expense
205
 
    company_id: base.main_company
206
 
    name: Expenses Journal (test)
207
 
    type: purchase
208
 
    allow_date: 0
209
 
    analytic_journal_id: account_analytic_journal_expenses_0
210
 
-
211
 
  I create Supplier 401 Payable Account.
212
 
-
213
 
  !record {model: account.account, id: account_account_payable_supplier0}:
214
 
    code: '401-supplier-test'
215
 
    company_id: base.main_company
216
 
    currency_mode: current
217
 
    name: Supplier Payable Account
218
 
    type: payable
219
 
    user_type: account_account_type_receivable0
220
 
    reconcile: 1
221
 
    type_for_register: none
222
 
    activation_date: !eval time.strftime('%Y-01-01')
223
 
-
224
 
  I create CC1 analytic account without any ending date (begin from 3 of this month)
225
 
-
226
 
  !record {model: account.analytic.account, id: cc1}:
227
 
    name: "Cost Center 1"
228
 
    code: CC1
229
 
    type: normal
230
 
    category: OC
231
 
    date_start: !eval "'%s-%s-03' % (datetime.now().year + 10, datetime.now().month)"
232
 
-
233
 
  I create CC2 analytic account with dates between 3 and 10 of the month
234
 
-
235
 
  !record {model: account.analytic.account, id: cc2}:
236
 
    name: Cost Center 2
237
 
    code: CC2
238
 
    type: normal
239
 
    category: OC
240
 
    date_start: !eval "'%s-%s-03' % (datetime.now().year + 10, datetime.now().month)"
241
 
    date: !eval "'%s-%s-13' % (datetime.now().year + 10, datetime.now().month)"
242
 
-
243
 
  I create CC3 analytic account without any ending date (begin from 15 of this month)
244
 
-
245
 
  !record {model: account.analytic.account, id: cc3}:
246
 
    name: Cost Center 3
247
 
    code: CC3
248
 
    type: normal
249
 
    category: OC
250
 
    date_start: !eval "'%s-%s-15' % (datetime.now().year + 10, datetime.now().month)"
251
 
-
252
 
  I create CC4 analytic account without any ending date (begin from 3 of this month)
253
 
-
254
 
  !record {model: account.analytic.account, id: cc4}:
255
 
    name: "Cost Center 4"
256
 
    code: CC4
257
 
    type: normal
258
 
    category: OC
259
 
    date_start: !eval "'%s-03-03' % (datetime.now().year)"
260
 
-
261
 
  I create CC5 analytic account without any ending date (begin from 15 of this month)
262
 
-
263
 
  !record {model: account.analytic.account, id: cc5}:
264
 
    name: Cost Center 5
265
 
    code: CC5
266
 
    type: normal
267
 
    category: OC
268
 
    date_start: !eval "'%s-03-15' % (datetime.now().year)"
269
 
-
270
 
  I create FP1 analytic account
271
 
-
272
 
  !record {model: account.analytic.account, id: fp1}:
273
 
    name: Funding Pool 1
274
 
    code: FP1
275
 
    type: normal
276
 
    category: FUNDING
277
 
    date_start: !eval "'%s-%s-03' % (datetime.now().year + 10, datetime.now().month)"
278
 
    date: !eval "'%s-%s-10' % (datetime.now().year + 10, datetime.now().month)"
279
 
    cost_center_ids: [cc1, cc2, cc3, cc4, cc5]
280
 
    tuple_destination_account_ids: [tuple_operation_6101, tuple_operation_6102]
281
 
-
282
 
  I create an analytic distribution.
283
 
-
284
 
  !record {model: analytic.distribution, id: distrib_2}:
285
 
    name: Distribution for checking dates, valid dates
286
 
-
287
 
  I add some lines to this distribution. First CC.
288
 
-
289
 
  !record {model: cost.center.distribution.line, id: cost_center_1}:
290
 
    name: CC Line 1
291
 
    analytic_id: cc1
292
 
    destination_id: analytic_account_destination_operation
293
 
    distribution_id: distrib_2
294
 
    percentage: 100.0
295
 
    currency_id: base.EUR
296
 
-
297
 
  Then I create a FP line linked to previous CC.
298
 
-
299
 
  !record {model: funding.pool.distribution.line, id: funding_pool_line_1}:
300
 
    name: FP Line 1
301
 
    analytic_id: analytic_account_msf_private_funds
302
 
    destination_id: analytic_account_destination_operation
303
 
    distribution_id: distrib_2
304
 
    cost_center_id: cc1
305
 
    percentage: 100.0
306
 
    currency_id: base.EUR
307
 
-
308
 
  I create another analytic distribution.
309
 
-
310
 
  !record {model: analytic.distribution, id: distrib_3}:
311
 
    name: Distribution for checking dates, INVALID dates
312
 
-
313
 
  I add some lines to this distribution. First CC.
314
 
-
315
 
  !record {model: cost.center.distribution.line, id: cost_center_2}:
316
 
    name: CC Line 1
317
 
    analytic_id: cc2
318
 
    destination_id: analytic_account_destination_operation
319
 
    distribution_id: distrib_3
320
 
    percentage: 100.0
321
 
    currency_id: base.EUR
322
 
-
323
 
  Then I create a FP line linked to previous CC.
324
 
-
325
 
  !record {model: funding.pool.distribution.line, id: funding_pool_line_2}:
326
 
    name: FP Line 1
327
 
    analytic_id: analytic_account_msf_private_funds
328
 
    destination_id: analytic_account_destination_operation
329
 
    distribution_id: distrib_3
330
 
    cost_center_id: cc2
331
 
    percentage: 100.0
332
 
    currency_id: base.EUR
333
 
-
334
 
  I create distrib_4 analytic distribution.
335
 
-
336
 
  !record {model: analytic.distribution, id: distrib_4}:
337
 
    name: Distribution for checking reverse and correction
338
 
-
339
 
  I add some lines to this distribution. First CC.
340
 
-
341
 
  !record {model: cost.center.distribution.line, id: cost_center_4}:
342
 
    name: CC Line 1
343
 
    analytic_id: cc4
344
 
    destination_id: analytic_account_destination_operation
345
 
    distribution_id: distrib_4
346
 
    percentage: 100.0
347
 
    currency_id: base.EUR
348
 
-
349
 
  Then I create a FP line linked to previous CC.
350
 
-
351
 
  !record {model: funding.pool.distribution.line, id: funding_pool_line_4}:
352
 
    name: FP Line 1
353
 
    analytic_id: analytic_account_msf_private_funds
354
 
    destination_id: analytic_account_destination_operation
355
 
    distribution_id: distrib_4
356
 
    cost_center_id: cc4
357
 
    percentage: 100.0
358
 
    currency_id: base.EUR
359
 
-
360
 
  I create a Partner Category named "Supplier".
361
 
-
362
 
  !record {model: res.partner.category, id: res_partner_category_supplier_0}:
363
 
    name: Supplier
364
 
-
365
 
  I create a Partner Category which are under "Supplier".
366
 
-
367
 
  !record {model: res.partner.category, id: res_partner_category_miscellaneous_supplier_0}:
368
 
    name: Miscellaneous Supplier
369
 
    parent_id: res_partner_category_supplier_0
370
 
-
371
 
  I create a Supplier named "Wood Supplier".
372
 
-
373
 
  !record {model: res.partner, id: res_partner_supplier_wood_0}:
374
 
    name: "Wood Supplier"
375
 
    category_id: 
376
 
      - res_partner_category_miscellaneous_supplier_0
377
 
    supplier: 1
378
 
-
379
 
  I create an address
380
 
-
381
 
  !record {model: res.partner.address, id: res_partner_address_tempo}:
382
 
    name: Maurice MORETTI
383
 
    street: 9, rue du Parc
384
 
    zip: 67205
385
 
    city: Oberhausbergen
386
 
    phone: +33 3 88 56 82 10
387
 
    email: info@tempo-consulting.fr
388
 
    partner_id: res_partner_supplier_wood_0
389
 
-
390
 
  I create a product to be used in some invoices
391
 
-
392
 
  !record {model: product.product, id: product_basic_finance_0}:
393
 
    categ_id: product.cat0
394
 
    cost_method: average
395
 
    mes_type: fixed
396
 
    name: Basic product for finance tests
397
 
    price_margin: 2.0
398
 
    procure_method: make_to_stock
399
 
    seller_delay: '1'
400
 
    standard_price: 12.0
401
 
    supply_method: buy
402
 
    type: product
403
 
    uom_id: product.product_uom_unit
404
 
    uom_po_id: product.product_uom_unit
405
 
    volume : 0.0
406
 
    warranty: 0.0
407
 
    weight: 0.0
408
 
    weight_net: 0.0
409
 
    seller_ids:
410
 
      - sequence: 10
411
 
        min_qty: 0.00
412
 
        name: res_partner_supplier_wood_0
413
 
    international_status: product_attributes.int_1
414
 
-
415
 
  I overwrite periods to have the right number
416
 
-
417
 
  !python {model: account.period}: |
418
 
    import datetime
419
 
    period_ids = self.search(cr, uid, [], order='date_start, name')
420
 
    for p in self.browse(cr, uid, period_ids):
421
 
      self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})