Merge lp:~openerp-dev/openobject-addons/trunk-clean-yml-account-tpa into lp:openobject-addons
- trunk-clean-yml-account-tpa
- Merge into trunk
Proposed by
Turkesh Patel (openERP)
Status: | Work in progress |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-clean-yml-account-tpa |
Merge into: | lp:openobject-addons |
Diff against target: |
2469 lines (+843/-1234) 36 files modified
account/__openerp__.py (+11/-12) account/account_demo.yml (+40/-0) account/account_report.xml (+1/-1) account/demo/account_demo.xml (+17/-0) account/demo/account_invoice_demo.xml (+107/-40) account/demo/bank_statement_demo.xml (+62/-0) account/test/account_automatic_reconcile_test.yml (+27/-0) account/test/account_bank_statement.yml (+0/-73) account/test/account_cash_statement.yml (+0/-81) account/test/account_change_currency.yml (+0/-79) account/test/account_customer_invoice.yml (+0/-112) account/test/account_fiscalyear_close_state.yml (+0/-19) account/test/account_invoice_state.yml (+0/-66) account/test/account_period_close.yml (+0/-45) account/test/account_report.yml (+66/-43) account/test/account_sequence_test.yml (+0/-43) account/test/account_supplier_invoice.yml (+0/-89) account/test/account_use_model.yml (+0/-73) account/test/chart_of_account.yml (+0/-73) account/test/draft2cancel_invoice.yml (+56/-0) account/test/invoice_process.yml (+197/-0) account/test/opening_entries.yml (+20/-79) account/test/price_accuracy00.yml (+0/-93) account/test/test_bank_cash_statement.yml (+91/-0) account/test/test_edi_invoice.yml (+29/-63) account/test/test_fiscalyear_process.yml (+46/-0) account/test/test_parent_structure.py (+0/-51) account/test/test_parent_structure.yml (+3/-4) account/test/test_recurring_entries.yml (+36/-0) account/test/validate_account_move.yml (+28/-94) account/wizard/account_invoice_state.py (+1/-0) account/wizard/account_invoice_state_view.xml (+1/-0) account/wizard/account_move_bank_reconcile.py (+1/-0) account/wizard/account_move_bank_reconcile_view.xml (+1/-0) account/wizard/account_move_line_select.py (+1/-0) account/wizard/account_move_line_select_view.xml (+1/-1) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-clean-yml-account-tpa |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphael Collet (OpenERP) (community) | Needs Fixing | ||
Ujjvala Collins | Pending | ||
Review via email: mp+86997@code.launchpad.net |
Commit message
Description of the change
Account
-------
Improved YML test cases of Account module.
To post a comment you must log in.
- 6040. By Turkesh Patel (openERP)
-
[REM]: Removed unnecessary changes.
- 6041. By Raphael Collet (OpenERP)
-
[MERGE] from trunk
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote : | # |
review:
Needs Fixing
- 6042. By Turkesh Patel (openERP)
-
[MRG] merge with main addons
- 6043. By Turkesh Patel (openERP)
-
[IMP] remove unnecessary changes.
- 6044. By Turkesh Patel (openERP)
-
[MRG] merge with main addons lp:openobject-addons
Unmerged revisions
- 6044. By Turkesh Patel (openERP)
-
[MRG] merge with main addons lp:openobject-addons
- 6043. By Turkesh Patel (openERP)
-
[IMP] remove unnecessary changes.
- 6042. By Turkesh Patel (openERP)
-
[MRG] merge with main addons
- 6041. By Raphael Collet (OpenERP)
-
[MERGE] from trunk
- 6040. By Turkesh Patel (openERP)
-
[REM]: Removed unnecessary changes.
- 6039. By Turkesh Patel (openERP)
-
[MRG] merge with main addons.
- 6038. By Turkesh Patel (openERP)
-
[IMP] Improved strings of YML test cases of account module
- 6037. By Turkesh Patel (openERP)
-
[IMP] Improved YML test cases in account module
- 6036. By Turkesh Patel (openERP)
-
[IMP] open2done_
fiscalyear. yml and open2done_ period_ fiscalyear. yml merged in test_fiscalyear _process. yml - 6035. By Turkesh Patel (openERP)
-
[IMP] draft2valid_
bank_statement. yml and draft2valid_ cash_statement. yml merged in test_bank_ cash_statement. yml
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'account/__openerp__.py' |
2 | --- account/__openerp__.py 2012-08-22 07:14:45 +0000 |
3 | +++ account/__openerp__.py 2012-08-24 13:00:40 +0000 |
4 | @@ -132,22 +132,21 @@ |
5 | 'project/analytic_account_demo.xml', |
6 | 'demo/account_minimal.xml', |
7 | 'demo/account_invoice_demo.xml', |
8 | -# 'account_unit_test.xml', |
9 | + 'demo/bank_statement_demo.xml', |
10 | ], |
11 | 'test': [ |
12 | - 'test/account_customer_invoice.yml', |
13 | - 'test/account_supplier_invoice.yml', |
14 | - 'test/account_change_currency.yml', |
15 | - 'test/chart_of_account.yml', |
16 | - 'test/account_period_close.yml', |
17 | - 'test/account_use_model.yml', |
18 | - 'test/account_validate_account_move.yml', |
19 | - 'test/account_fiscalyear_close.yml', |
20 | - #'test/account_bank_statement.yml', |
21 | - #'test/account_cash_statement.yml', |
22 | + 'test/draft2cancel_invoice.yml', |
23 | + 'test/invoice_process.yml', |
24 | + 'test/test_parent_structure.yml', |
25 | + 'test/validate_account_move.yml', |
26 | + 'test/test_recurring_entries.yml', |
27 | 'test/test_edi_invoice.yml', |
28 | + 'account_demo.yml', |
29 | + 'test/test_bank_cash_statement.yml', |
30 | + 'test/test_fiscalyear_process.yml', |
31 | + 'test/account_automatic_reconcile_test.yml', |
32 | + 'test/opening_entries.yml', |
33 | 'test/account_report.yml', |
34 | - 'test/account_fiscalyear_close_state.yml', #last test, as it will definitively close the demo fiscalyear |
35 | ], |
36 | 'installable': True, |
37 | 'auto_install': False, |
38 | |
39 | === added file 'account/account_demo.yml' |
40 | --- account/account_demo.yml 1970-01-01 00:00:00 +0000 |
41 | +++ account/account_demo.yml 2012-08-24 13:00:40 +0000 |
42 | @@ -0,0 +1,40 @@ |
43 | +- |
44 | + !record {model: account.invoice, id: account_invoice_1}: |
45 | + partner_id: base.res_partner_9 |
46 | + payment_term: account.account_payment_term_net |
47 | + journal_id: account.sales_journal |
48 | + company_id: base.main_company |
49 | + invoice_line: |
50 | + - product_id: product.product_product_hdd1 |
51 | + quantity: 10.0 |
52 | + - product_id: product.product_product_employee0 |
53 | + quantity: 4.5 |
54 | + |
55 | +- |
56 | + !record {model: account.bank.statement, id: account_bank_statement_2}: |
57 | + name: Bank Test |
58 | + journal_id: account.bank_journal |
59 | + date: 2011-10-07 |
60 | + line_ids: |
61 | + - partner_id: base.res_partner_6 |
62 | + name: Bank Line Test |
63 | + account_id: account.a_recv |
64 | + type: general |
65 | + |
66 | +- |
67 | + !record {model: account.move.line, id: account_move_line_1}: |
68 | + name: Account Move Line Test |
69 | + journal_id: account.bank_journal |
70 | + account_id: account.a_recv |
71 | + currency_id: base.EUR |
72 | + date: 2011-10-07 |
73 | + partner_id: base.res_partner_6 |
74 | + period_id: account.period_6 |
75 | + |
76 | +- |
77 | + !record {model: account.invoice.tax, id: account_invoice_tax_1}: |
78 | + name: test_tax |
79 | + account_id: account.a_sale |
80 | + amount: 30 |
81 | + base: 150 |
82 | + |
83 | |
84 | === modified file 'account/account_report.xml' |
85 | --- account/account_report.xml 2012-08-08 10:14:19 +0000 |
86 | +++ account/account_report.xml 2012-08-24 13:00:40 +0000 |
87 | @@ -40,7 +40,7 @@ |
88 | name="Taxes" |
89 | groups="group_account_user,group_account_manager" |
90 | parent="account.menu_finance_generic_reporting" sequence="3"/> |
91 | - |
92 | + <!-- TODO: Dead Code- This Feature is Removed (object-account.account.balance.landscape) --> |
93 | <report id="account_account_balance_landscape" |
94 | string="Account balance" |
95 | model="account.account" |
96 | |
97 | === modified file 'account/demo/account_demo.xml' |
98 | --- account/demo/account_demo.xml 2012-08-07 06:48:10 +0000 |
99 | +++ account/demo/account_demo.xml 2012-08-24 13:00:40 +0000 |
100 | @@ -14,9 +14,26 @@ |
101 | <field name="company_id" ref="base.main_company"/> |
102 | </record> |
103 | |
104 | + <record id="data_fiscalyear2" model="account.fiscalyear"> |
105 | + <field eval="'Fiscal Year2 X '+time.strftime('%Y')+ 'Next'" name="name"/> |
106 | + <field eval="'FY'+time.strftime('%Y')" name="code"/> |
107 | + <field eval="time.strftime('%Y')+'1'+'-01-01'" name="date_start"/> |
108 | + <field eval="time.strftime('%Y')+'1'+'-12-31'" name="date_stop"/> |
109 | + <field name="company_id" ref="base.main_company"/> |
110 | + </record> |
111 | + |
112 | <!-- |
113 | Fiscal Periods |
114 | --> |
115 | + <record id="period_for_fiscalyear2" model="account.period"> |
116 | + <field eval="'01/'+time.strftime('%Y')" name="code"/> |
117 | + <field eval="'OP'+time.strftime('%Y')" name="name"/> |
118 | + <field eval="1" name="special"/> |
119 | + <field name="fiscalyear_id" ref="data_fiscalyear2"/> |
120 | + <field eval="time.strftime('%Y')+'1'+'-01-01'" name="date_start"/> |
121 | + <field eval="time.strftime('%Y')+'1'+'-01-01'" name="date_stop"/> |
122 | + <field name="company_id" ref="base.main_company"/> |
123 | + </record> |
124 | |
125 | <record id="period_1" model="account.period"> |
126 | <field eval="'01/'+time.strftime('%Y')" name="code"/> |
127 | |
128 | === modified file 'account/demo/account_invoice_demo.xml' |
129 | --- account/demo/account_invoice_demo.xml 2012-07-25 09:48:36 +0000 |
130 | +++ account/demo/account_invoice_demo.xml 2012-08-24 13:00:40 +0000 |
131 | @@ -1,48 +1,115 @@ |
132 | <?xml version="1.0" ?> |
133 | <openerp> |
134 | - <data noupdate="1"> |
135 | - <record id="demo_invoice_0" model="account.invoice"> |
136 | - <field name="date_due" eval="time.strftime('%Y')+'-01-30'"/> |
137 | - <field name="payment_term" ref="account.account_payment_term"/> |
138 | - <field name="journal_id" ref="account.expenses_journal"/> |
139 | + <data noupdate="1"> |
140 | + <record id="demo_invoice_0" model="account.invoice"> |
141 | + <field name="date_due" eval="time.strftime('%Y')+'-01-30'"/> |
142 | + <field name="payment_term" ref="account.account_payment_term"/> |
143 | + <field name="journal_id" ref="account.expenses_journal"/> |
144 | + <field name="currency_id" ref="base.EUR"/> |
145 | + <field name="address_invoice_id" ref="base.res_partner_address_wong"/> |
146 | + <field name="user_id" ref="base.user_demo"/> |
147 | + <field name="address_contact_id" ref="base.res_partner_address_wong"/> |
148 | + <field name="reference_type">none</field> |
149 | + <field name="company_id" ref="base.main_company"/> |
150 | + <field name="state">draft</field> |
151 | + <field name="type">in_invoice</field> |
152 | + <field name="account_id" ref="account.a_pay"/> |
153 | + <field eval="0" name="reconciled"/> |
154 | + <field name="date_invoice" eval="time.strftime('%Y')+'-01-01'"/> |
155 | + <field eval="14.0" name="amount_untaxed"/> |
156 | + <field eval="14.0" name="amount_total"/> |
157 | + <field eval="14.0" name="check_total"/> |
158 | + <field name="partner_id" ref="base.res_partner_maxtor"/> |
159 | + </record> |
160 | + <record id="demo_invoice_0_line_rpanrearpanelshe0" model="account.invoice.line"> |
161 | + <field name="invoice_id" ref="demo_invoice_0"/> |
162 | + <field name="account_id" ref="account.a_expense"/> |
163 | + <field name="uos_id" ref="product.product_uom_unit"/> |
164 | + <field name="price_unit" eval="10.0" /> |
165 | + <field name="price_subtotal" eval="10.0" /> |
166 | + <field name="company_id" ref="base.main_company"/> |
167 | + <field name="invoice_line_tax_id" eval="[(6,0,[])]"/> |
168 | + <field name="product_id" ref="product.product_product_rearpanelarm0"/> |
169 | + <field name="quantity" eval="1.0" /> |
170 | + <field name="partner_id" ref="base.res_partner_maxtor"/> |
171 | + <field name="name">[RPAN100] Rear Panel SHE100</field> |
172 | + </record> |
173 | + <record id="demo_invoice_0_line_rckrackcm0" model="account.invoice.line"> |
174 | + <field name="invoice_id" ref="demo_invoice_0"/> |
175 | + <field name="account_id" ref="account.a_expense"/> |
176 | + <field name="uos_id" ref="product.product_uom_unit"/> |
177 | + <field name="price_unit" eval="4.0"/> |
178 | + <field name="price_subtotal" eval="4.0"/> |
179 | + <field name="company_id" ref="base.main_company"/> |
180 | + <field name="invoice_line_tax_id" eval="[(6,0,[])]"/> |
181 | + <field name="product_id" ref="product.product_product_shelf1"/> |
182 | + <field name="quantity" eval="1.0" /> |
183 | + <field name="partner_id" ref="base.res_partner_maxtor"/> |
184 | + <field name="name">[RCK200] Rack 200cm</field> |
185 | + </record> |
186 | + <record id="account_invoice_0" model="account.invoice"> |
187 | + <field name="payment_term" ref="account.account_payment_term_net"/> |
188 | + <field name="journal_id" ref="account.sales_journal"/> |
189 | <field name="currency_id" ref="base.EUR"/> |
190 | - <field name="user_id" ref="base.user_demo"/> |
191 | + <field name="address_invoice_id" ref="base.res_partner_address_1"/> |
192 | + <field name="user_id" ref="base.user_admin"/> |
193 | + <field name="address_contact_id" ref="base.res_partner_address_1"/> |
194 | <field name="reference_type">none</field> |
195 | <field name="company_id" ref="base.main_company"/> |
196 | + <field eval="100.66" name="amount_tax"/> |
197 | <field name="state">draft</field> |
198 | - <field name="type">in_invoice</field> |
199 | - <field name="account_id" ref="account.a_pay"/> |
200 | + <field name="type">out_invoice</field> |
201 | + <field name="account_id" ref="account.a_recv"/> |
202 | <field eval="0" name="reconciled"/> |
203 | - <field name="date_invoice" eval="time.strftime('%Y')+'-01-01'"/> |
204 | - <field eval="14.0" name="amount_untaxed"/> |
205 | - <field eval="14.0" name="amount_total"/> |
206 | - <field name="partner_id" ref="base.res_partner_17"/> |
207 | - </record> |
208 | - <record id="demo_invoice_0_line_rpanrearpanelshe0" model="account.invoice.line"> |
209 | - <field name="invoice_id" ref="demo_invoice_0"/> |
210 | - <field name="account_id" ref="account.a_expense"/> |
211 | - <field name="uos_id" ref="product.product_uom_unit"/> |
212 | - <field name="price_unit" eval="10.0" /> |
213 | - <field name="price_subtotal" eval="10.0" /> |
214 | - <field name="company_id" ref="base.main_company"/> |
215 | - <field name="invoice_line_tax_id" eval="[(6,0,[])]"/> |
216 | - <field name="product_id" ref="product.product_product_39"/> |
217 | - <field name="quantity" eval="1.0" /> |
218 | - <field name="partner_id" ref="base.res_partner_16"/> |
219 | - <field name="name">Toner Cartridge</field> |
220 | - </record> |
221 | - <record id="demo_invoice_0_line_rckrackcm0" model="account.invoice.line"> |
222 | - <field name="invoice_id" ref="demo_invoice_0"/> |
223 | - <field name="account_id" ref="account.a_expense"/> |
224 | - <field name="uos_id" ref="product.product_uom_unit"/> |
225 | - <field name="price_unit" eval="4.0"/> |
226 | - <field name="price_subtotal" eval="4.0"/> |
227 | - <field name="company_id" ref="base.main_company"/> |
228 | - <field name="invoice_line_tax_id" eval="[(6,0,[])]"/> |
229 | - <field name="product_id" ref="product.product_product_43"/> |
230 | - <field name="quantity" eval="1.0" /> |
231 | - <field name="partner_id" ref="base.res_partner_17"/> |
232 | - <field name="name">Zed+ Antivirus</field> |
233 | - </record> |
234 | - </data> |
235 | + <field name="date_invoice">2011-10-07</field> |
236 | + <field eval="1385.3" name="amount_untaxed"/> |
237 | + <field eval="1385.3" name="amount_total"/> |
238 | + <field name="partner_id" ref="base.res_partner_9"/> |
239 | + </record> |
240 | + <record id="account_tax_test0" model="account.tax"> |
241 | + <field eval="1" name="sequence"/> |
242 | + <field eval="1.0" name="base_sign"/> |
243 | + <field eval="0" name="child_depend"/> |
244 | + <field eval="0" name="include_base_amount"/> |
245 | + <field name="applicable_type">true</field> |
246 | + <field name="company_id" ref="base.main_company"/> |
247 | + <field name="type">percent</field> |
248 | + <field eval="1.0" name="ref_base_sign"/> |
249 | + <field name="description">test_tax</field> |
250 | + <field name="type_tax_use">all</field> |
251 | + <field eval="1" name="active"/> |
252 | + <field eval="1.0" name="ref_tax_sign"/> |
253 | + <field name="name">test purpose</field> |
254 | + <field eval="0.2" name="amount"/> |
255 | + <field eval="1.0" name="tax_sign"/> |
256 | + <field eval="0" name="price_include"/> |
257 | + </record> |
258 | + <record id="account_invoice_line_hddhddseagategb0" model="account.invoice.line"> |
259 | + <field name="uos_id" ref="product.product_uom_unit"/> |
260 | + <field name="account_id" ref="account.a_sale"/> |
261 | + <field name="invoice_id" ref="account_invoice_0"/> |
262 | + <field eval="50.33" name="price_unit"/> |
263 | + <field eval="503.3" name="price_subtotal"/> |
264 | + <field name="company_id" ref="base.main_company"/> |
265 | + <field eval="[(6,0,[ref('account_tax_test0')])]" name="invoice_line_tax_id"/> |
266 | + <field name="product_id" ref="product.product_product_hdd1"/> |
267 | + <field eval="10.0" name="quantity"/> |
268 | + <field name="partner_id" ref="base.res_partner_desertic_hispafuentes"/> |
269 | + <field name="name">[HDD1] HDD Seagate 7200.8 80GB</field> |
270 | + </record> |
271 | + <record id="account_invoice_line_emplemployee0" model="account.invoice.line"> |
272 | + <field name="uos_id" ref="product.uom_hour"/> |
273 | + <field name="account_id" ref="account.a_sale"/> |
274 | + <field name="invoice_id" ref="account_invoice_0"/> |
275 | + <field eval="200.0" name="price_unit"/> |
276 | + <field eval="882.0" name="price_subtotal"/> |
277 | + <field eval="2.0" name="discount"/> |
278 | + <field name="company_id" ref="base.main_company"/> |
279 | + <field eval="[(6,0,[])]" name="invoice_line_tax_id"/> |
280 | + <field name="product_id" ref="product.product_product_employee0"/> |
281 | + <field eval="4.5" name="quantity"/> |
282 | + <field name="partner_id" ref="base.res_partner_desertic_hispafuentes"/> |
283 | + <field name="name">[EMPL] Employee</field> |
284 | + </record> |
285 | + </data> |
286 | </openerp> |
287 | |
288 | === added file 'account/demo/bank_statement_demo.xml' |
289 | --- account/demo/bank_statement_demo.xml 1970-01-01 00:00:00 +0000 |
290 | +++ account/demo/bank_statement_demo.xml 2012-08-24 13:00:40 +0000 |
291 | @@ -0,0 +1,62 @@ |
292 | +<?xml version="1.0" ?> |
293 | +<openerp> |
294 | + <data noupdate="1"> |
295 | + <record id="account_bank_statement_0" model="account.bank.statement"> |
296 | + <field name="user_id" ref="base.user_admin"/> |
297 | + <field name="name">/</field> |
298 | + <field name="state">draft</field> |
299 | + <field eval="0.0" name="balance_end"/> |
300 | + <field eval="0.0" name="balance_start"/> |
301 | + <field name="company_id" ref="base.main_company"/> |
302 | + <field name="journal_id" ref="account.bank_journal"/> |
303 | + <field name="period_id" ref="account.period_10"/> |
304 | + <field name="date">2011-10-07</field> |
305 | + </record> |
306 | + <record id="account_bank_statement_line_a0" model="account.bank.statement.line"> |
307 | + <field name="statement_id" ref="account_bank_statement_0"/> |
308 | + <field eval="1" name="sequence"/> |
309 | + <field name="type">general</field> |
310 | + <field name="partner_id" ref="base.res_partner_6"/> |
311 | + <field name="company_id" ref="base.main_company"/> |
312 | + <field name="account_id" ref="account.a_recv"/> |
313 | + <field eval="[(6,0,[])]" name="move_ids"/> |
314 | + <field eval="1000.0" name="amount"/> |
315 | + <field name="date">2011-10-07</field> |
316 | + <field name="name">a</field> |
317 | + </record> |
318 | + |
319 | + |
320 | + <!-- Cash statement Demo --> |
321 | + |
322 | + <record id="account_bank_statement_1" model="account.bank.statement"> |
323 | + <field name="user_id" ref="base.user_admin"/> |
324 | + <field name="name">/</field> |
325 | + <field name="state">draft</field> |
326 | + <field name="journal_id" ref="account.cash_journal"/> |
327 | + <field name="period_id" ref="account.period_10"/> |
328 | + <field eval="0.0" name="balance_end"/> |
329 | + <field eval="0.0" name="balance_end_cash"/> |
330 | + <field name="company_id" ref="base.main_company"/> |
331 | + </record> |
332 | + |
333 | + <record id="account_bank_statement_line_2" model="account.bank.statement.line"> |
334 | + <field name="statement_id" ref="account_bank_statement_1"/> |
335 | + <field eval="1" name="sequence"/> |
336 | + <field name="type">general</field> |
337 | + <field name="partner_id" ref="base.res_partner_6"/> |
338 | + <field name="company_id" ref="base.main_company"/> |
339 | + <field name="account_id" ref="account.a_recv"/> |
340 | + <field eval="[(6,0,[])]" name="move_ids"/> |
341 | + <field eval="1000.0" name="amount"/> |
342 | + <field name="name">cash line</field> |
343 | + </record> |
344 | + |
345 | + <record id="account_cashbox_line_cash_end" model="account.cashbox.line"> |
346 | + <field eval="500" name="pieces"/> |
347 | + <field eval="2" name="number"/> |
348 | + <field eval="1000" name="subtotal"/> |
349 | + <field name="ending_id" ref="account_bank_statement_1"/> |
350 | + </record> |
351 | + |
352 | + </data> |
353 | +</openerp> |
354 | |
355 | === added file 'account/test/account_automatic_reconcile_test.yml' |
356 | --- account/test/account_automatic_reconcile_test.yml 1970-01-01 00:00:00 +0000 |
357 | +++ account/test/account_automatic_reconcile_test.yml 2012-08-24 13:00:40 +0000 |
358 | @@ -0,0 +1,27 @@ |
359 | +- |
360 | + In order to test Automatic Reconcile feature of account, |
361 | +- |
362 | + I create an Account Automatic Reconcile . |
363 | +- |
364 | + !record {model: account.automatic.reconcile, id: account_automatic_reconcile_0}: |
365 | + account_ids: |
366 | + - account.a_pay |
367 | + - account.a_recv |
368 | + allow_write_off: True |
369 | +- |
370 | + I reconcile the Automatic Reconcile. |
371 | +- |
372 | + !python {model: account.automatic.reconcile}: | |
373 | + self.reconcile(cr, uid, [ref("account_automatic_reconcile_0")]) |
374 | +- |
375 | + In order to print taxes report I create an Account VAT declaration based on invoices. |
376 | +- |
377 | + I create an Account Vat Declaration for create vat. |
378 | +- |
379 | + !record {model: account.vat.declaration, id: account_account_vat_0}: |
380 | + based_on: invoices |
381 | +- |
382 | + I create vat based on tax and amount. |
383 | +- |
384 | + !python {model: account.vat.declaration}: | |
385 | + self.create_vat(cr, uid, [ref('account_account_vat_0')], {"active_ids": [ref("account.menu_account_vat_declaration")]}) |
386 | |
387 | === removed file 'account/test/account_bank_statement.yml' |
388 | --- account/test/account_bank_statement.yml 2012-08-07 11:06:16 +0000 |
389 | +++ account/test/account_bank_statement.yml 1970-01-01 00:00:00 +0000 |
390 | @@ -1,73 +0,0 @@ |
391 | -- |
392 | - In order to test Bank Statement feature of account I create a bank statement line and confirm it and check it's move created |
393 | -- |
394 | - I select the period and journal for the bank statement |
395 | -- |
396 | - !python {model: account.bank.statement}: | |
397 | - import time |
398 | - journal = self._default_journal_id(cr, uid, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu', |
399 | - 'journal_type': 'bank', 'period_id': time.strftime('%m'), 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')}) |
400 | - assert journal, _('Journal has not been selected') |
401 | -- |
402 | - I create a bank statement with Opening and Closing balance 0. |
403 | -- |
404 | - !record {model: account.bank.statement, id: account_bank_statement_0}: |
405 | - balance_end_real: 0.0 |
406 | - balance_start: 0.0 |
407 | - date: !eval time.strftime('%Y-%m-%d') |
408 | - journal_id: account.bank_journal |
409 | -- |
410 | - I create bank statement line |
411 | -- |
412 | - !python {model: account.bank.statement.line}: | |
413 | - partner = self.onchange_partner_id(cr, uid, [], ref('base.res_partner_4'), context=None) |
414 | - vals = { |
415 | - 'account_id': partner['value']['account_id'], |
416 | - 'amount': 1000.0, |
417 | - 'partner_id': ref('base.res_partner_4'), |
418 | - 'statement_id': ref('account_bank_statement_0'), |
419 | - 'name': 'EXT001' |
420 | - } |
421 | - vals.update(partner.get('value',{})) |
422 | - line_id = self.create(cr, uid, vals) |
423 | - assert line_id, "Account bank statement line has not been created" |
424 | -- |
425 | - I compute bank statement using Compute button |
426 | -- |
427 | - !python {model: account.bank.statement}: | |
428 | - self.button_dummy(cr, uid, [ref("account_bank_statement_0")]) |
429 | - |
430 | -- |
431 | - I modify the bank statement and set the Closing Balance. |
432 | -- |
433 | - !record {model: account.bank.statement, id: account_bank_statement_0}: |
434 | - balance_end_real: 1000.0 |
435 | - |
436 | -- |
437 | - I confirm the bank statement using Confirm button |
438 | -- |
439 | - !python {model: account.bank.statement}: | |
440 | - self.button_confirm_bank(cr, uid, [ref("account_bank_statement_0")]) |
441 | -- |
442 | - I check that bank statement state is now "Closed" |
443 | -- |
444 | - !assert {model: account.bank.statement, id: account_bank_statement_0}: |
445 | - - state == 'confirm' |
446 | - |
447 | -- |
448 | - I check that move lines created for bank statement and move state is Posted |
449 | -- |
450 | - !python {model: account.bank.statement}: | |
451 | - move_line_obj = self.pool.get('account.move.line') |
452 | - bank_data = self.browse(cr, uid, ref("account_bank_statement_0")) |
453 | - assert bank_data.move_line_ids, "Move lines not created for bank statement" |
454 | - for line in bank_data.move_line_ids: |
455 | - assert line.move_id.state == 'posted', "Move state is not posted" |
456 | -- |
457 | - Then I cancel Bank Statements and verifies that it raises a warning |
458 | -- |
459 | - !python {model: account.bank.statement}: | |
460 | - try: |
461 | - self.button_cancel(cr, uid, [ref("account_bank_statement_0")]) |
462 | - except Exception, e: |
463 | - assert e[0]=='User Error!', 'Another exception has been raised!' |
464 | |
465 | === removed file 'account/test/account_cash_statement.yml' |
466 | --- account/test/account_cash_statement.yml 2012-07-18 14:28:10 +0000 |
467 | +++ account/test/account_cash_statement.yml 1970-01-01 00:00:00 +0000 |
468 | @@ -1,81 +0,0 @@ |
469 | -- |
470 | - In order to test Cash statement I create a Cash statement and confirm it and check its move created |
471 | -- |
472 | - !record {model: account.bank.statement, id: account_bank_statement_1}: |
473 | - date: !eval time.strftime('%Y-%m-%d') |
474 | - journal_id: account.cash_journal |
475 | - name: / |
476 | - period_id: account.period_10 |
477 | - user_id: base.user_root |
478 | - starting_details_ids: |
479 | - - pieces: 10.0 |
480 | - number: 2 |
481 | - subtotal: 20.0 |
482 | - - pieces: 100.0 |
483 | - number: 1 |
484 | - subtotal: 100.0 |
485 | - balance_start: 120.0 |
486 | - balance_end: 120.0 |
487 | -- |
488 | - I check that Initially bank statement is in the "Draft" state |
489 | -- |
490 | - !assert {model: account.bank.statement, id: account_bank_statement_1}: |
491 | - - state == 'draft' |
492 | - |
493 | -- |
494 | - I clicked on Open CashBox button to open the cashbox |
495 | -- |
496 | - !python {model: account.bank.statement}: | |
497 | - self.button_open(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }) |
498 | - |
499 | -- |
500 | - I check that now bank statement is in the "Open" state |
501 | -- |
502 | - !assert {model: account.bank.statement, id: account_bank_statement_1}: |
503 | - - state == 'open' |
504 | - |
505 | -- |
506 | - I enter values in Closing balance before close the cashbox |
507 | -- |
508 | - !record {model: account.bank.statement, id: account_bank_statement_1}: |
509 | - line_ids: |
510 | - - account_id: account.a_recv |
511 | - amount: 1000.0 |
512 | - date: !eval time.strftime('%Y-%m-%d') |
513 | - name: test |
514 | - partner_id: base.res_partner_4 |
515 | - sequence: 0.0 |
516 | - type: general |
517 | - balance_end: 1120.0 |
518 | - ending_details_ids: |
519 | - - pieces: 10.0 |
520 | - number: 2 |
521 | - subtotal: 20.0 |
522 | - - pieces: 100.0 |
523 | - number: 1 |
524 | - subtotal: 100.0 |
525 | - - pieces: 500.0 |
526 | - number: 2 |
527 | - subtotal: 1000.0 |
528 | - |
529 | -- |
530 | - I clicked on Close CashBox button to close the cashbox |
531 | -- |
532 | - !python {model: account.bank.statement}: | |
533 | - self.button_confirm_cash(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }) |
534 | - |
535 | -- |
536 | - I check that bank statement state is now "Closed" |
537 | -- |
538 | - !assert {model: account.bank.statement, id: account_bank_statement_1}: |
539 | - - state == 'confirm' |
540 | - |
541 | -- |
542 | - I check that move lines created for bank statement and move state is Posted |
543 | -- |
544 | - !python {model: account.bank.statement}: | |
545 | - move_line_obj = self.pool.get('account.move.line') |
546 | - bank_data = self.browse(cr, uid, ref("account_bank_statement_1")) |
547 | - assert bank_data.move_line_ids, "Move lines not created for bank statement" |
548 | - for line in bank_data.move_line_ids: |
549 | - assert line.move_id.state == 'posted', "Move state is not posted" |
550 | |
551 | === removed file 'account/test/account_change_currency.yml' |
552 | --- account/test/account_change_currency.yml 2012-08-16 08:42:24 +0000 |
553 | +++ account/test/account_change_currency.yml 1970-01-01 00:00:00 +0000 |
554 | @@ -1,79 +0,0 @@ |
555 | -- |
556 | - In order to test change currency wizard I create an invoice with currency "EUR" and change it to "USD" using the wizard |
557 | -- |
558 | - !record {model: account.invoice, id: account_invoice_currency}: |
559 | - account_id: account.a_recv |
560 | - company_id: base.main_company |
561 | - currency_id: base.EUR |
562 | - invoice_line: |
563 | - - account_id: account.a_sale |
564 | - name: '[PCSC234] PC Assemble SC234' |
565 | - price_unit: 450.0 |
566 | - quantity: 1.0 |
567 | - product_id: product.product_product_3 |
568 | - uos_id: product.product_uom_unit |
569 | - journal_id: account.sales_journal |
570 | - partner_id: base.res_partner_12 |
571 | - reference_type: none |
572 | - |
573 | -- |
574 | - I check that Initially customer invoice is in the draft state |
575 | -- |
576 | - !assert {model: account.invoice, id: account_invoice_currency, string: Customer Invoice is in Draft state}: |
577 | - - state == 'draft' |
578 | -- |
579 | - Now I select USD as new currency |
580 | -- |
581 | - !record {model: account.change.currency, id: account_change_currency_0}: |
582 | - currency_id: base.USD |
583 | -- |
584 | - I clicked on Change Currency button to change the currency |
585 | -- |
586 | - !python {model: account.change.currency}: | |
587 | - self.view_init(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', |
588 | - "active_model": "account.invoice", "tz": False, "active_ids": |
589 | - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), |
590 | - }) |
591 | - self.change_currency(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', |
592 | - "active_model": "account.invoice", "tz": False, "active_ids": |
593 | - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), |
594 | - }) |
595 | -- |
596 | - I change the state of invoice to proforma2 by clicking PRO-FORMA button |
597 | -- |
598 | - !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_currency} |
599 | -- |
600 | - I check that now customer invoice is in the "proforma2" state |
601 | -- |
602 | - !assert {model: account.invoice, id: account_invoice_currency}: |
603 | - - state == 'proforma2' |
604 | -- |
605 | - I can't change the currency of invoice when it is not in draft state so I change the state to cancel |
606 | -- |
607 | - !workflow {model: account.invoice, action: invoice_cancel, ref: account_invoice_currency} |
608 | -- |
609 | - I change the state to "Draft" |
610 | -- |
611 | - !python {model: account.invoice}: | |
612 | - self.action_cancel_draft(cr, uid, [ref("account_invoice_currency")], {"lang": 'en_US', |
613 | - "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_invoice_tree1")], |
614 | - "type": "out_invoice", "active_id": ref("account.menu_action_invoice_tree1"), |
615 | - }) |
616 | -- |
617 | - I change the currency. |
618 | -- |
619 | - !record {model: account.change.currency, id: account_change_currency_0}: |
620 | - currency_id: base.USD |
621 | -- |
622 | - I clicked on Change Currency button to change the currency |
623 | -- |
624 | - !python {model: account.change.currency}: | |
625 | - self.change_currency(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', |
626 | - "active_model": "account.invoice", "tz": False, "active_ids": |
627 | - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), |
628 | - }) |
629 | -- |
630 | - I check that the currency is changed successfully |
631 | -- |
632 | - !assert {model: account.invoice, id: account_invoice_currency, string: Currency changed from EUR to USD}: |
633 | - - currency_id.id == ref("base.USD") |
634 | |
635 | === removed file 'account/test/account_customer_invoice.yml' |
636 | --- account/test/account_customer_invoice.yml 2012-08-13 05:14:11 +0000 |
637 | +++ account/test/account_customer_invoice.yml 1970-01-01 00:00:00 +0000 |
638 | @@ -1,112 +0,0 @@ |
639 | -- |
640 | - In order to test account invoice I create a new customer invoice |
641 | -- |
642 | - I will create bank detail |
643 | -- |
644 | - !record {model: res.partner.bank, id: res_partner_bank_0}: |
645 | - state: bank |
646 | - company_id: base.main_company |
647 | - partner_id: base.main_partner |
648 | - acc_number: 123456789 |
649 | - footer: True |
650 | - bank: base.res_bank_1 |
651 | - bank_name: Reserve |
652 | -- |
653 | - I create a customer invoice |
654 | -- |
655 | - !record {model: account.invoice, id: account_invoice_customer0, view: invoice_form}: |
656 | - payment_term: account.account_payment_term_advance |
657 | - partner_bank_id: res_partner_bank_0 |
658 | - journal_id: account.sales_journal |
659 | - partner_id: base.res_partner_3 |
660 | - reference_type: none |
661 | - name: 'Test Customer Invoice' |
662 | - invoice_line: |
663 | - - product_id: product.product_product_5 |
664 | - quantity: 10.0 |
665 | -- |
666 | - I manually assign tax on invoice |
667 | -- |
668 | - !python {model: account.invoice.tax}: | |
669 | - amt = self.amount_change(cr, uid, [], 50.0, ref('base.EUR'), ref('base.main_company'), False) |
670 | - base_amt = self.base_change(cr, uid, [], 9000.0, ref('base.EUR'), ref('base.main_company'), False) |
671 | - invoice_tax_line = { |
672 | - 'name': 'Test Tax for Customer Invoice', |
673 | - 'manual': 1, |
674 | - 'base': base_amt['value']['base_amount'], |
675 | - 'amount': amt['value']['tax_amount'], |
676 | - 'account_id': ref('account.ova'), |
677 | - 'invoice_id': ref("account_invoice_customer0"), |
678 | - } |
679 | - tax = self.create(cr, uid, invoice_tax_line) |
680 | - assert tax, "Tax has not been assigned correctly" |
681 | - |
682 | -- |
683 | - I check that Initially customer invoice is in the "Draft" state |
684 | -- |
685 | - !assert {model: account.invoice, id: account_invoice_customer0}: |
686 | - - state == 'draft' |
687 | -- |
688 | - I change the state of invoice to "Proforma2" by clicking PRO-FORMA button |
689 | -- |
690 | - !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_customer0} |
691 | -- |
692 | - I check that the invoice state is now "Proforma2" |
693 | -- |
694 | - !assert {model: account.invoice, id: account_invoice_customer0}: |
695 | - - state == 'proforma2' |
696 | -- |
697 | - I check that there is no move attached to the invoice |
698 | -- |
699 | - !python {model: account.invoice}: | |
700 | - acc_id=self.browse(cr, uid, ref("account_invoice_customer0")) |
701 | - assert (not acc_id.move_id), "Move falsely created at pro-forma" |
702 | -- |
703 | - I create invoice by clicking on Create button |
704 | -- |
705 | - !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_customer0} |
706 | -- |
707 | - I check that the invoice state is "Open" |
708 | -- |
709 | - !assert {model: account.invoice, id: account_invoice_customer0}: |
710 | - - state == 'open' |
711 | - |
712 | -- |
713 | - I check that now there is a move attached to the invoice |
714 | -- |
715 | - !python {model: account.invoice}: | |
716 | - acc_id=self.browse(cr, uid, ref("account_invoice_customer0")) |
717 | - assert acc_id.move_id, "Move not created for open invoice" |
718 | -- |
719 | - I pay the Invoice |
720 | -- |
721 | - !python {model: account.invoice}: | |
722 | - import time |
723 | - pay = self.pay_and_reconcile(cr, uid, [ref('account_invoice_customer0')], |
724 | - 9050.0, ref('cash'), ref('account.period_10'), |
725 | - ref('bank_journal'), ref('cash'), |
726 | - ref('account.period_10'), ref('bank_journal'), |
727 | - name='Payment for test customer invoice') |
728 | - assert (pay == True), "Incorrect Payment" |
729 | -- |
730 | - I verify that invoice is now in Paid state |
731 | -- |
732 | - !python {model: account.invoice}: | |
733 | - inv = self.browse(cr, uid, ref("account_invoice_customer0")) |
734 | - assert (inv.state == 'paid'), "Invoice is not in Paid state" |
735 | -- |
736 | - I refund the invoice Using Refund Button |
737 | -- |
738 | - !record {model: account.invoice.refund, id: account_invoice_refund_0}: |
739 | - description: Refund To China Export |
740 | - period: account.period_5 |
741 | - filter_refund: refund |
742 | -- |
743 | - I clicked on refund button |
744 | -- |
745 | - !python {model: account.invoice.refund}: | |
746 | - self.invoice_refund(cr, uid, [ref("account_invoice_refund_0")], {"lang": 'en_US', "tz": False, "active_model": "account.invoice", "active_ids": [ref("account.account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account.account_invoice_customer0"), }) |
747 | -- |
748 | - I checked that a new entry with state "Draft" created in account move line |
749 | - |
750 | - |
751 | |
752 | === removed file 'account/test/account_fiscalyear_close_state.yml' |
753 | --- account/test/account_fiscalyear_close_state.yml 2011-12-19 16:54:40 +0000 |
754 | +++ account/test/account_fiscalyear_close_state.yml 1970-01-01 00:00:00 +0000 |
755 | @@ -1,19 +0,0 @@ |
756 | -- |
757 | - I run the Close a Fiscalyear wizard to close the demo fiscalyear |
758 | -- |
759 | - !record {model: account.fiscalyear.close.state, id: account_fiscalyear_close_state_0}: |
760 | - fy_id: data_fiscalyear |
761 | -- |
762 | - I clicked on Close States Button to close fiscalyear |
763 | - |
764 | -- |
765 | - !python {model: account.fiscalyear.close.state}: | |
766 | - self.data_save(cr, uid, [ref("account_fiscalyear_close_state_0")], {"lang": 'en_US', |
767 | - "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_fy_close_state")], |
768 | - "tz": False, "active_id": ref("account.menu_wizard_fy_close_state"), }) |
769 | -- |
770 | - I check that the fiscalyear state is now "Done" |
771 | -- |
772 | - !assert {model: account.fiscalyear, id: data_fiscalyear, string: Fiscal Year is in Done state}: |
773 | - - state == 'done' |
774 | - |
775 | |
776 | === removed file 'account/test/account_invoice_state.yml' |
777 | --- account/test/account_invoice_state.yml 2012-08-16 08:42:24 +0000 |
778 | +++ account/test/account_invoice_state.yml 1970-01-01 00:00:00 +0000 |
779 | @@ -1,66 +0,0 @@ |
780 | -- |
781 | - In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard |
782 | -- |
783 | - !record {model: account.invoice, id: account_invoice_state}: |
784 | - account_id: account.a_recv |
785 | - company_id: base.main_company |
786 | - currency_id: base.EUR |
787 | - invoice_line: |
788 | - - account_id: account.a_sale |
789 | - name: '[PCSC234] PC Assemble SC234' |
790 | - price_unit: 450.0 |
791 | - quantity: 1.0 |
792 | - product_id: product.product_product_3 |
793 | - uos_id: product.product_uom_unit |
794 | - journal_id: account.bank_journal |
795 | - partner_id: base.res_partner_12 |
796 | - reference_type: none |
797 | -- |
798 | - I check that Initially customer invoice state is "Draft" |
799 | -- |
800 | - !assert {model: account.invoice, id: account_invoice_state}: |
801 | - - state == 'draft' |
802 | -- |
803 | - I called the "Confirm Draft Invoices" wizard |
804 | -- |
805 | - !record {model: account.invoice.confirm, id: account_invoice_confirm_0}: |
806 | - {} |
807 | -- |
808 | - I clicked on Confirm Invoices Button |
809 | -- |
810 | - !python {model: account.invoice.confirm}: | |
811 | - self.invoice_confirm(cr, uid, [ref("account_invoice_confirm_0")], {"lang": 'en_US', |
812 | - "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")], |
813 | - "type": "out_invoice", "active_id": ref("account_invoice_state"), }) |
814 | -- |
815 | - I check that customer invoice state is "Open" |
816 | -- |
817 | - !assert {model: account.invoice, id: account_invoice_state}: |
818 | - - state == 'open' |
819 | -- |
820 | - I Modified the journal record so it can cancel invoice |
821 | -- |
822 | - !record {model: account.journal, id: account.bank_journal}: |
823 | - update_posted: 1 |
824 | - |
825 | - |
826 | -- |
827 | - In order to check the "Cancel Selected Invoices" wizard in openerp I cancelled this open invoice using this wizard |
828 | -- |
829 | - !record {model: account.invoice.cancel, id: account_invoice_cancel_0}: |
830 | - {} |
831 | - |
832 | -- |
833 | - I clicked on Cancel Invoices Button |
834 | -- |
835 | - !python {model: account.invoice.cancel}: | |
836 | - self.invoice_cancel(cr, uid, [ref("account_invoice_cancel_0")], {"lang": 'en_US', |
837 | - "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")], |
838 | - "type": "out_invoice", "active_id": ref("account_invoice_state"), }) |
839 | - |
840 | -- |
841 | - I check that customer invoice is in the cancel state |
842 | -- |
843 | - !assert {model: account.invoice, id: account_invoice_state}: |
844 | - - state == 'cancel' |
845 | - |
846 | |
847 | === removed file 'account/test/account_period_close.yml' |
848 | --- account/test/account_period_close.yml 2012-01-02 15:04:25 +0000 |
849 | +++ account/test/account_period_close.yml 1970-01-01 00:00:00 +0000 |
850 | @@ -1,45 +0,0 @@ |
851 | - |
852 | -- |
853 | - In order to test close period wizard I first create a dummy fiscal year in the past to avoid conflicts related to closed periods |
854 | -- |
855 | - !record {model: account.fiscalyear, id: data_fiscalyear_minus1}: |
856 | - company_id: base.main_company |
857 | - date_start: !eval "'%s-01-01' %(datetime.now().year-1)" |
858 | - date_stop: !eval "'%s-12-31' %(datetime.now().year-1)" |
859 | - name: !eval "'Fiscal Year X %s' %(datetime.now().year-1)" |
860 | - code: !eval "'FY%s' %(datetime.now().year-1)" |
861 | - |
862 | -- |
863 | - I create a period then close it and checked it's state |
864 | -- |
865 | - !record {model: account.period, id: account_period_jan0}: |
866 | - company_id: base.main_company |
867 | - date_start: !eval "'%s-01-01' %(datetime.now().year-1)" |
868 | - date_stop: !eval "'%s-01-31' %(datetime.now().year-1)" |
869 | - fiscalyear_id: data_fiscalyear_minus1 |
870 | - name: !eval "'Jan-%s' %(datetime.now().year-1)" |
871 | - special: 1 |
872 | - |
873 | -- |
874 | - I check that the period state is "Draft" |
875 | -- |
876 | - !assert {model: account.period, id: account_period_jan0, string: Period is in Draft state}: |
877 | - - state == 'draft' |
878 | -- |
879 | - I use "Close a Period" wizard to close period |
880 | -- |
881 | - !record {model: account.period.close, id: account_period_close_0}: |
882 | - sure: 1 |
883 | -- |
884 | - I clicked on Close Period Button to close Period |
885 | - |
886 | -- |
887 | - !python {model: account.period.close}: | |
888 | - self.data_save(cr, uid, [ref("account_period_close_0")], {"lang": 'en_US', "active_model": |
889 | - "account.period", "active_ids": [ref("account_period_jan0")], "tz": False, "active_id": |
890 | - ref("account_period_jan0"), }) |
891 | -- |
892 | - I check that the period state is "Done" |
893 | -- |
894 | - !assert {model: account.period, id: account_period_jan0, string: Period is in Done state}: |
895 | - - state == 'done' |
896 | |
897 | === modified file 'account/test/account_report.yml' |
898 | --- account/test/account_report.yml 2012-06-19 07:16:24 +0000 |
899 | +++ account/test/account_report.yml 2012-08-24 13:00:40 +0000 |
900 | @@ -1,5 +1,28 @@ |
901 | - |
902 | - In order to test the PDF reports defined on an invoice, we will create a Invoice Record |
903 | + In order to check a financial report, I have create record for financial report. |
904 | +- |
905 | + !record {model: account.financial.report, id: account_financial_report_reporttest0}: |
906 | + name: Report test |
907 | +- |
908 | + I create a record for get a financial report. |
909 | +- |
910 | + !record {model: accounting.report, id: accounting_report_0}: |
911 | + account_report_id: account_financial_report_reporttest0 |
912 | + chart_account_id: chart0 |
913 | + date_from_cmp: !eval time.strftime('%Y-%m-%d') |
914 | + date_to_cmp: !eval time.strftime('%Y-%m-%d') |
915 | + enable_filter: true |
916 | + filter: filter_no |
917 | + filter_cmp: filter_date |
918 | + label_filter: balance |
919 | + target_move: posted |
920 | +- |
921 | + I perform a action to print a report. |
922 | +- |
923 | + !python {model: accounting.report}: | |
924 | + self.check_report(cr, uid, [ref("accounting_report_0")], {"active_model": "ir.ui.menu", "active_ids": [ref("menu_account_report")], "active_id": ref("menu_account_vat_declaration"), }) |
925 | +- |
926 | + In order to test the PDF reports defined on an invoice, we will create a Invoice Record. |
927 | - |
928 | !record {model: account.invoice, id: test_invoice_1}: |
929 | currency_id: base.EUR |
930 | @@ -10,16 +33,16 @@ |
931 | account_id: account.a_recv |
932 | name: Test invoice 1 |
933 | - |
934 | - In order to test the PDF reports defined on an invoice, we will print an Invoice Report |
935 | + In order to test the PDF reports defined on an invoice, we will print an Invoice Report. |
936 | - |
937 | !python {model: account.invoice}: | |
938 | import netsvc, tools, os |
939 | - (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {}) |
940 | + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_0')], {}, {}) |
941 | if tools.config['test_report_directory']: |
942 | file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) |
943 | |
944 | - |
945 | - In order to test the PDF reports defined on a partner, we will print the Overdue Report |
946 | + In order to test the PDF reports defined on a partner, we will print the Overdue Report. |
947 | - |
948 | !python {model: res.partner}: | |
949 | import netsvc, tools, os |
950 | @@ -83,49 +106,45 @@ |
951 | ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) |
952 | data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False} |
953 | from tools import test_reports |
954 | - test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account') |
955 | + test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu', wiz_data=data_dict, context=ctx, our_module='account') |
956 | - |
957 | - Print the General Ledger Report in Landscape Mode |
958 | + Print the General Ledger Report in Landscape Mode. |
959 | - |
960 | !python {model: account.account}: | |
961 | - ctx={} |
962 | - ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) |
963 | + ctx = {'model': 'account.account','active_ids':[ref('account.chart0')]} |
964 | data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True} |
965 | from tools import test_reports |
966 | - test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account') |
967 | + test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu', wiz_data=data_dict, context=ctx, our_module='account') |
968 | - |
969 | - Print Journal Report - From Model |
970 | + Print Journal Report - From Model. |
971 | - |
972 | !python {model: account.journal.period}: | |
973 | journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] |
974 | - ctx={} |
975 | - ctx.update({'model': 'account.journal.period','active_ids':journal_ids}) |
976 | - data_dict = {'chart_account_id':ref('account.chart0'), 'period_from':ref('period_1'), 'period_to':ref('period_12')} |
977 | - from tools import test_reports |
978 | - test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account') |
979 | -- |
980 | - Print the Partner Balance Report |
981 | -- |
982 | - !python {model: account.account}: | |
983 | - ctx={} |
984 | - data_dict = {'chart_account_id':ref('account.chart0')} |
985 | - ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) |
986 | - from tools import test_reports |
987 | - test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account') |
988 | -- |
989 | - Print the Partner Ledger Report |
990 | -- |
991 | - !python {model: account.account}: | |
992 | - ctx={} |
993 | + ctx = {'model': 'account.journal.period','active_ids':journal_ids} |
994 | + data_dict = {'chart_account_id':ref('account.chart0')} |
995 | + from tools import test_reports |
996 | + test_reports.try_report_action(cr, uid, 'action_account_print_journal', wiz_data=data_dict, context=ctx, our_module='account') |
997 | +- |
998 | + Print the Partner Balance Report. |
999 | +- |
1000 | + !python {model: account.account}: | |
1001 | + ctx = {'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')} |
1002 | + data_dict = {'chart_account_id':ref('account.chart0')} |
1003 | + from tools import test_reports |
1004 | + test_reports.try_report_action(cr, uid, 'action_account_partner_balance', wiz_data=data_dict, context=ctx, our_module='account') |
1005 | +- |
1006 | + Print the Partner Ledger Report. |
1007 | +- |
1008 | + !python {model: account.account}: | |
1009 | + ctx = {'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')} |
1010 | data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True} |
1011 | - ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) |
1012 | from tools import test_reports |
1013 | - test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account') |
1014 | + test_reports.try_report_action(cr, uid, 'action_account_partner_ledger', wiz_data=data_dict, context=ctx, our_module='account') |
1015 | - |
1016 | - Print the Partner Ledger-Other Report |
1017 | + Print the Partner Ledger-Other Report. |
1018 | - |
1019 | !python {model: res.partner}: | |
1020 | - ctx={} |
1021 | + ctx = {'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')} |
1022 | data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False} |
1023 | ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')}) |
1024 | from tools import test_reports |
1025 | @@ -173,18 +192,22 @@ |
1026 | Print the Analytic Journal Report through the wizard |
1027 | - |
1028 | !python {model: account.analytic.journal}: | |
1029 | - ctx={} |
1030 | - ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]}) |
1031 | - data_dict = {} |
1032 | + ctx = {'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]} |
1033 | from tools import test_reports |
1034 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account') |
1035 | + test_reports.try_report_action(cr, uid, 'action_account_analytic_journal', context=ctx, our_module='account') |
1036 | |
1037 | - |
1038 | - Print the Inverted Analytic Balance Report through the wizard |
1039 | + Print the Inverted Analytic Balance Report through the wizard. |
1040 | - |
1041 | !python {model: account.analytic.account}: | |
1042 | - ctx={} |
1043 | - ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) |
1044 | - data_dict = {} |
1045 | - from tools import test_reports |
1046 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') |
1047 | + ctx = {'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]} |
1048 | + from tools import test_reports |
1049 | + test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance', context=ctx, our_module='account') |
1050 | + |
1051 | +- |
1052 | + Print the vat declaration Report through the wizard. |
1053 | +- |
1054 | + !python {model: account.vat.declaration}: | |
1055 | + ctx = {'model': 'account.vat.declaration','active_ids': [ref('account_account_vat_0')]} |
1056 | + from tools import test_reports |
1057 | + test_reports.try_report_action(cr, uid, 'action_account_vat_declaration', context=ctx, our_module='account') |
1058 | |
1059 | === removed file 'account/test/account_sequence_test.yml' |
1060 | --- account/test/account_sequence_test.yml 2012-08-16 08:42:24 +0000 |
1061 | +++ account/test/account_sequence_test.yml 1970-01-01 00:00:00 +0000 |
1062 | @@ -1,43 +0,0 @@ |
1063 | -- In order to test the invoice numbering, I create a sequence for out invoices. |
1064 | -- !record {model: ir.sequence, id: seq_out_invoice_test}: |
1065 | - name: Account Invoice Out for the demonstration Fiscal Year # XXX indicate the name of the fiscal year |
1066 | - code: account.invoice.out_invoice |
1067 | - padding: 3 |
1068 | - prefix: FY- |
1069 | - suffix: -TEST |
1070 | - number_next: 42 |
1071 | - |
1072 | -- I link the new sequence to the demo sequence and the demo fiscal years. |
1073 | -- !record {model: account.sequence.fiscalyear, id: seq_out_invoice_test_fy}: |
1074 | - sequence_id: seq_out_invoice_test |
1075 | - sequence_main_id: seq_out_invoice |
1076 | - fiscalyear_id: data_fiscalyear |
1077 | - |
1078 | -- I create a draft customer invoice in a period of the demo fiscal year |
1079 | -- !record {model: account.invoice, id: invoice_seq_test}: |
1080 | - account_id: account.a_recv |
1081 | - company_id: base.main_company |
1082 | - currency_id: base.EUR |
1083 | - invoice_line: |
1084 | - - account_id: account.a_sale |
1085 | - name: '[PC-DEM] PC on Demand' |
1086 | - price_unit: 900.0 |
1087 | - quantity: 10.0 |
1088 | - product_id: product.product_product_5 |
1089 | - uos_id: product.product_uom_unit |
1090 | - journal_id: account.sales_journal |
1091 | - partner_id: base.res_partner_3 |
1092 | - reference_type: none |
1093 | - period_id: period_1 |
1094 | - |
1095 | -- I create the invoice, as I clicked on the "Create" button |
1096 | -- !workflow {model: account.invoice, action: invoice_open, ref: invoice_seq_test} |
1097 | - |
1098 | -- I check that the invoice state is "Open" |
1099 | -- !assert {model: account.invoice, id: invoice_seq_test}: |
1100 | - - state == 'open' |
1101 | - |
1102 | -- I check that the invoice got the right number using our sequence |
1103 | - # This used to fail because of bug #602188 |
1104 | -- !assert {model: account.invoice, id: invoice_seq_test}: |
1105 | - - number == 'FY-042-TEST' |
1106 | |
1107 | === removed file 'account/test/account_supplier_invoice.yml' |
1108 | --- account/test/account_supplier_invoice.yml 2012-08-16 08:42:24 +0000 |
1109 | +++ account/test/account_supplier_invoice.yml 1970-01-01 00:00:00 +0000 |
1110 | @@ -1,89 +0,0 @@ |
1111 | -- |
1112 | - In order to test account invoice I create a new supplier invoice |
1113 | -- |
1114 | - I create a Tax Codes |
1115 | -- |
1116 | - !record {model: account.tax.code, id: tax_case}: |
1117 | - name: Tax_case |
1118 | - company_id: base.main_company |
1119 | - sign: 1 |
1120 | -- |
1121 | - I create a Tax |
1122 | -- |
1123 | - !record {model: account.tax, id: tax10}: |
1124 | - name: Tax 10.0 |
1125 | - amount: 10.0 |
1126 | - type: fixed |
1127 | - sequence: 1 |
1128 | - company_id: base.main_company |
1129 | - type_tax_use: all |
1130 | - tax_code_id: tax_case |
1131 | -- |
1132 | - I create a supplier invoice |
1133 | -- |
1134 | - !record {model: account.invoice, id: account_invoice_supplier0}: |
1135 | - account_id: account.a_pay |
1136 | - check_total: 3000.0 |
1137 | - company_id: base.main_company |
1138 | - currency_id: base.EUR |
1139 | - invoice_line: |
1140 | - - account_id: account.a_expense |
1141 | - name: '[PCSC234] PC Assemble SC234' |
1142 | - price_unit: 300.0 |
1143 | - product_id: product.product_product_3 |
1144 | - quantity: 10.0 |
1145 | - uos_id: product.product_uom_unit |
1146 | - invoice_line_tax_id: |
1147 | - - tax10 |
1148 | - journal_id: account.expenses_journal |
1149 | - partner_id: base.res_partner_12 |
1150 | - reference_type: none |
1151 | - type: in_invoice |
1152 | -- |
1153 | - I check that Initially supplier invoice state is "Draft" |
1154 | -- |
1155 | - !assert {model: account.invoice, id: account_invoice_supplier0}: |
1156 | - - state == 'draft' |
1157 | -- |
1158 | - I change the state of invoice to open by clicking Validate button |
1159 | -- |
1160 | - !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_supplier0} |
1161 | -- |
1162 | - I check that the invoice state is now "Open" |
1163 | -- |
1164 | - !assert {model: account.invoice, id: account_invoice_supplier0}: |
1165 | - - state == 'open' |
1166 | -- |
1167 | - I verify that account move is created |
1168 | -- |
1169 | - !python {model: account.invoice}: | |
1170 | - move_obj = self.pool.get('account.move') |
1171 | - inv = self.browse(cr, uid, ref('account_invoice_supplier0')) |
1172 | - move = inv.move_id |
1173 | - get_period = move_obj._get_period(cr, uid, {'lang': u'en_US', 'active_model': 'ir.ui.menu', |
1174 | - 'active_ids': [ref('menu_action_move_journal_line_form')], 'tz': False, 'active_id': ref('menu_action_move_journal_line_form')}) |
1175 | - amt = move_obj._search_amount(cr, uid, move_obj, 'amount', [('amount', '=', 3100.0)], {'lang': u'en_US', 'active_model': 'ir.ui.menu', |
1176 | - 'active_ids': [ref('menu_action_move_journal_line_form')], 'tz': False, 'active_id': ref('menu_action_move_journal_line_form')}) |
1177 | - ids = amt[0][2] |
1178 | - amt_compute = move_obj._amount_compute(cr, uid, list(ids), 'amount', None, {'lang': u'en_US', 'active_model': 'ir.ui.menu', |
1179 | - 'active_ids': [ref('menu_action_move_journal_line_form')], 'tz': False, 'active_id': ref('menu_action_move_journal_line_form')}, where ='') |
1180 | - move_amount = amt_compute.values() |
1181 | - assert(inv.move_id and move.period_id.id == get_period and move_amount[0] == 3100.0), ('Journal Entries has not been created') |
1182 | -- |
1183 | - I cancel the account move which is in posted state and verifies that it gives warning message |
1184 | -- |
1185 | - !python {model: account.move}: | |
1186 | - inv_obj = self.pool.get('account.invoice') |
1187 | - inv = inv_obj.browse(cr, uid, ref('account_invoice_supplier0')) |
1188 | - try: |
1189 | - mov_cancel = self.button_cancel(cr, uid, [inv.move_id.id], {'lang': u'en_US', 'tz': False, |
1190 | - 'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'active_ids': [ref('menu_action_invoice_tree2')], |
1191 | - 'type': 'in_invoice', 'active_id': ref('menu_action_invoice_tree2')}) |
1192 | - except Exception, e: |
1193 | - assert e, 'Warning message has not been raised' |
1194 | -- |
1195 | - I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values |
1196 | -- |
1197 | - !python {model: account.tax.code}: | |
1198 | - tax_code = self.browse(cr, uid, ref('tax_case')) |
1199 | - assert(tax_code.sum_period == 100.0 and tax_code.sum == 100.0), "Incorrect 'Period Sum' / 'Year sum' expected twice 100.0, got period=%r and year=%r)" % (tax_code.sum_period,tax_code.sum) |
1200 | |
1201 | === removed file 'account/test/account_use_model.yml' |
1202 | --- account/test/account_use_model.yml 2011-11-14 23:23:11 +0000 |
1203 | +++ account/test/account_use_model.yml 1970-01-01 00:00:00 +0000 |
1204 | @@ -1,73 +0,0 @@ |
1205 | -- |
1206 | - In order to test account use models wizard in OpenERP I create an account model record |
1207 | -- |
1208 | - !record {model: account.model, id: account_model_mymodelonyears0}: |
1209 | - journal_id: account.expenses_journal |
1210 | - lines_id: |
1211 | - - account_id: account.a_recv |
1212 | - credit: 0.0 |
1213 | - debit: 100.0 |
1214 | - name: model_line_db |
1215 | - sequence: 0.0 |
1216 | - quantity: 0.0 |
1217 | - partner_id: base.res_partner_3 |
1218 | - - account_id: account.a_pay |
1219 | - credit: 100.0 |
1220 | - debit: 0.0 |
1221 | - name: model_line_cr |
1222 | - sequence: 0.0 |
1223 | - quantity: 0.0 |
1224 | - partner_id: base.res_partner_3 |
1225 | - name: My Test Model |
1226 | -- |
1227 | - I create an account use model record |
1228 | -- |
1229 | - !record {model: account.use.model, id: account_use_model_0}: |
1230 | - {} |
1231 | -- |
1232 | - I create entries. |
1233 | -- |
1234 | - !python {model: account.use.model}: | |
1235 | - self.create_entries(cr, uid, [ref("account_use_model_0")], {"lang": 'en_US', "active_model": |
1236 | - "account.model", "active_ids": [ref("account_model_mymodelonyears0")], "tz": |
1237 | - False, "active_id": ref("account_model_mymodelonyears0"), }) |
1238 | - move_obj = self.pool.get('account.move') |
1239 | - ids = move_obj.search(cr, uid, [('ref', '=', 'My Test Model')]) |
1240 | - assert len(ids), "Error:moves not created for model 'My Test Model'" |
1241 | -- |
1242 | - Then I click on the 'Post' button of Journal Entries |
1243 | -- |
1244 | - !python {model: account.move}: | |
1245 | - ids = self.search(cr, uid, [('ref', '=', 'My Test Model')]) |
1246 | - self.button_validate(cr, uid, ids, {}) |
1247 | - moves = self.browse(cr, uid, ids)[0] |
1248 | - assert(moves.state == 'posted'), _('Journal Entries are not in posted state') |
1249 | -- |
1250 | - Then I create Recurring Lines |
1251 | -- |
1252 | - !record {model: account.subscription, id: test_recurring_lines }: |
1253 | - name: Test Recurring Lines |
1254 | - model_id: account_model_mymodelonyears0 |
1255 | - period_type: 'day' |
1256 | -- |
1257 | - Then I click on the 'Compute' button of Recurring lines |
1258 | -- |
1259 | - !python {model: account.subscription}: | |
1260 | - subscription_line_obj = self.pool.get('account.subscription.line') |
1261 | - self.compute(cr, uid, [ref('test_recurring_lines')], {'lang': u'en_US', 'active_model': 'ir.ui.menu', |
1262 | - 'active_ids': [ref('menu_action_subscription_form')], 'tz': False, 'active_id': ref('menu_action_subscription_form')}) |
1263 | - subscription_lines = subscription_line_obj.search(cr, uid, [('subscription_id', '=', ref('test_recurring_lines'))]) |
1264 | - assert subscription_lines, _('Subscription lines has not been created') |
1265 | -- |
1266 | - I provide date in 'Generate Entries' wizard |
1267 | -- |
1268 | - !record {model: account.subscription.generate, id: account_subscription_generate}: |
1269 | - date: !eval time.strftime('%Y-%m-%d') |
1270 | -- |
1271 | - Then I generate entries through wizard |
1272 | -- |
1273 | - !python {model: account.subscription.generate}: | |
1274 | - res = self.action_generate(cr, uid, [ref('account_subscription_generate')], {'lang': u'en_US', 'active_model': 'ir.ui.menu', |
1275 | - 'active_ids': [ref('menu_generate_subscription')], 'tz': False, 'active_id': ref('menu_generate_subscription')}) |
1276 | - assert res, _('Move for subscription lines has not been created') |
1277 | - |
1278 | |
1279 | === removed file 'account/test/chart_of_account.yml' |
1280 | --- account/test/chart_of_account.yml 2011-11-08 10:07:00 +0000 |
1281 | +++ account/test/chart_of_account.yml 1970-01-01 00:00:00 +0000 |
1282 | @@ -1,73 +0,0 @@ |
1283 | -- |
1284 | - In order to check the Chart of Accounts wizard I run the wizard with target move set as all |
1285 | - |
1286 | -- |
1287 | - !record {model: account.chart, id: account_chart_0}: |
1288 | - target_move: all |
1289 | -- |
1290 | - I clicked on Open chart Button to open the chart |
1291 | -- |
1292 | - !python {model: account.chart}: | |
1293 | - self.account_chart_open_window(cr, uid, [ref("account_chart_0")], {"lang": 'en_US', |
1294 | - "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_account_tree2")], |
1295 | - "tz": False, "active_id": ref("account.menu_action_account_tree2"), }) |
1296 | - |
1297 | -- |
1298 | - I create chart of accounts with target move set as posted |
1299 | -- |
1300 | - !record {model: account.chart, id: account_chart_0}: |
1301 | - target_move: posted |
1302 | -- |
1303 | - I clicked on Open chart Button to open the chart |
1304 | -- |
1305 | - !python {model: account.chart}: | |
1306 | - self.account_chart_open_window(cr, uid, [ref("account_chart_0")], {"lang": 'en_US', |
1307 | - "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_account_tree2")], |
1308 | - "tz": False, "active_id": ref("account.menu_action_account_tree2"), }) |
1309 | - |
1310 | -#- |
1311 | -# In order to test Account Move Line Wizard I check the move line entries using this wizard |
1312 | -#- |
1313 | -# !record {model: account.move.line.select, id: account_move_line_select_0}: |
1314 | -# {} |
1315 | -#- |
1316 | -# I clicked on Button to open the account move lines |
1317 | -#- |
1318 | -# !python {model: account.move.line.select}: | |
1319 | -# self.open_window(cr, uid, [ref("account_move_line_select_0")], {"lang": 'en_US', |
1320 | -# "state": "all", "tz": False, "active_model": "account.account", "active_ids": |
1321 | -# [ref("account.a_recv")], "fiscalyear": 1, "active_id": ref("account.a_recv"), |
1322 | -# }) |
1323 | -- |
1324 | - In order to test the Analytic Charts of Account wizard I will generate chart |
1325 | - |
1326 | -- |
1327 | - !record {model: account.analytic.chart, id: account_analytic_chart_0}: |
1328 | - from_date: !eval "'%s-01-01' %(datetime.now().year)" |
1329 | - to_date: !eval "'%s-06-30' %(datetime.now().year)" |
1330 | -- |
1331 | - I clicked on Open chart Button to open the charts |
1332 | - |
1333 | -- |
1334 | - !python {model: account.analytic.chart}: | |
1335 | - self.analytic_account_chart_open_window(cr, uid, [ref("account_analytic_chart_0")], |
1336 | - {"lang": 'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_analytic_account_tree2")], |
1337 | - "tz": False, "active_id": ref("account.menu_action_analytic_account_tree2"), |
1338 | - }) |
1339 | - |
1340 | -- |
1341 | - In order to test Account Journal Select wizard I open journal entries using this wizard |
1342 | -- |
1343 | - !record {model: account.journal.select, id: account_journal_select_0}: |
1344 | - {} |
1345 | -- |
1346 | - I clicked on Open Journal Button to open the entries |
1347 | - |
1348 | -- |
1349 | - !python {model: account.journal.select}: | |
1350 | - self.action_open_window(cr, uid, [ref("account_journal_select_0")], {"lang": |
1351 | - 'en_US', "active_model": "account.journal.period", "active_ids": [ref("account.a_recv")], |
1352 | - "tz": False, "active_id": ref("account.a_recv"), }) |
1353 | -- |
1354 | - I check that the entries open successfully |
1355 | - |
1356 | |
1357 | === added file 'account/test/draft2cancel_invoice.yml' |
1358 | --- account/test/draft2cancel_invoice.yml 1970-01-01 00:00:00 +0000 |
1359 | +++ account/test/draft2cancel_invoice.yml 2012-08-24 13:00:40 +0000 |
1360 | @@ -0,0 +1,56 @@ |
1361 | +- |
1362 | + In order to test the cancel process of the Customer invoice, |
1363 | +- |
1364 | + I set the invoice to "Pro-Forma". |
1365 | +- |
1366 | + !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_0} |
1367 | +- |
1368 | + I check that the invoice state is now "Pro-Forma" |
1369 | +- |
1370 | + !assert {model: account.invoice, id: account_invoice_0, severity: error, string: Invoice should be in "Pro-Forma" state}: |
1371 | + - state == 'proforma2' |
1372 | +- |
1373 | + I check that there is no move attached to the invoice at Pro-Forma. |
1374 | +- |
1375 | + !python {model: account.invoice}: | |
1376 | + invoice_id=self.browse(cr, uid, ref("account_invoice_0")) |
1377 | + assert (not invoice_id.move_id), "Move should not created at Pro-Forma." |
1378 | +- |
1379 | + I open the invoice. |
1380 | +- |
1381 | + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_0} |
1382 | +- |
1383 | + I check that the invoice in "Open" state. |
1384 | +- |
1385 | + !assert {model: account.invoice, id: account_invoice_0, severity: error, string: Invoice should be in "Open" state}: |
1386 | + - state == 'open' |
1387 | +- |
1388 | + I modify the journal to allow cancelling the invoices. |
1389 | +- |
1390 | + !record {model: account.journal, id: sales_journal}: |
1391 | + update_posted: 1 |
1392 | +- |
1393 | + Now, I cancel the invoice. |
1394 | +- |
1395 | + !workflow {model: account.invoice, action: invoice_cancel, ref: account_invoice_0} |
1396 | +- |
1397 | + I check that the invoice is now in "Cancelled" state. |
1398 | +- |
1399 | + !assert {model: account.invoice, id: account_invoice_0, severity: error, string: Invoice should be in "Cancelled" state}: |
1400 | + - state == 'cancel' |
1401 | +- |
1402 | + I check there is no move attached to the invoice. |
1403 | +- |
1404 | + !python {model: account.invoice}: | |
1405 | + invoice = self.browse(cr, uid, ref("account_invoice_0")) |
1406 | + assert (not invoice.move_id), "Move should not be created." |
1407 | +- |
1408 | + I again set invoice to draft. |
1409 | +- |
1410 | + !python {model: account.invoice}: | |
1411 | + self.action_cancel_draft(cr, uid, [ref("account_invoice_0")]) |
1412 | +- |
1413 | + I check that the invoice is now in "Draft" state. |
1414 | +- |
1415 | + !assert {model: account.invoice, id: account_invoice_0, severity: error, string: Invoice should be in "Draft" state}: |
1416 | + - state == 'draft' |
1417 | |
1418 | === added file 'account/test/invoice_process.yml' |
1419 | --- account/test/invoice_process.yml 1970-01-01 00:00:00 +0000 |
1420 | +++ account/test/invoice_process.yml 2012-08-24 13:00:40 +0000 |
1421 | @@ -0,0 +1,197 @@ |
1422 | +- |
1423 | + In order to test the process of the Customer invoice, |
1424 | +- |
1425 | + I set USD as new currency. |
1426 | +- |
1427 | + !python {model: account.change.currency}: | |
1428 | + new_id = self.create(cr ,uid , {'currency_id': ref("base.USD")}) |
1429 | + self.change_currency(cr, uid, [new_id], { |
1430 | + "active_model": "account.invoice", "active_ids": |
1431 | + [ref("account.account_invoice_0")], "active_id": ref("account.account_invoice_0")}) |
1432 | +- |
1433 | + I check that the currency is changed successfully. |
1434 | +- |
1435 | + !assert {model: account.invoice, id: account_invoice_0, string: Currency changed from EUR to USD}: |
1436 | + - currency_id.id == ref("base.USD") |
1437 | +- |
1438 | + I check the unit price is change as per changing a currency. |
1439 | +- |
1440 | + !python {model: account.invoice}: | |
1441 | + invoice = self.browse(cr, uid, ref("account_invoice_0")) |
1442 | + assert invoice.invoice_line[0].price_unit == 64.59, "Amount is not changed as per currency" |
1443 | + assert invoice.invoice_line[1].price_unit == 256.68, "Amount is not changed as per currency" |
1444 | +- |
1445 | + I change EUR as new currency. |
1446 | +- |
1447 | + !python {model: account.change.currency}: | |
1448 | + new_id = self.create(cr ,uid , {'currency_id': ref("base.EUR")}) |
1449 | + self.change_currency(cr, uid, [new_id], {"lang": 'en_US', |
1450 | + "active_model": "account.invoice", "active_ids": |
1451 | + [ref("account.account_invoice_0")], "active_id": ref("account.account_invoice_0"), |
1452 | + }) |
1453 | +- |
1454 | + I set invoice in "Pro-Forma" state. |
1455 | +- |
1456 | + !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_0} |
1457 | +- |
1458 | + I check that the invoice is now in "Pro-Forma" state. |
1459 | +- |
1460 | + !assert {model: account.invoice, id: account_invoice_0, severity: error, string: Invoice should be in "Pro-Forma" state}: |
1461 | + - state == 'proforma2' |
1462 | +- |
1463 | + I set the invoice in "Open" state. |
1464 | +- |
1465 | + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_0} |
1466 | +- |
1467 | + To check that the invoice in "Open" state. |
1468 | +- |
1469 | + !assert {model: account.invoice, id: account_invoice_0, severity: error, string: Invoice should be in "Open" state}: |
1470 | + - state == 'open' |
1471 | +- |
1472 | + In order to test account move line of journal, I check there is a move attached to the invoice. |
1473 | +- |
1474 | + !python {model: account.invoice}: | |
1475 | + invoice_id=self.browse(cr, uid, ref("account_invoice_0")) |
1476 | + assert invoice_id.move_id, "Move not created for open invoice" |
1477 | +- |
1478 | + In order to test account invoice Period, I check there is a Period attached to the invoice. |
1479 | +- |
1480 | + !python {model: account.invoice}: | |
1481 | + invoice=self.browse(cr, uid, ref("account_invoice_0")) |
1482 | + assert invoice.period_id, "Period is not created for open invoice" |
1483 | +- |
1484 | + In order to test account invoice date ,I check there is an invoice date attached to the invoice. |
1485 | +- |
1486 | + !python {model: account.invoice}: | |
1487 | + invoice=self.browse(cr, uid, ref("account_invoice_0")) |
1488 | + assert invoice.date_invoice, "invoice date is not created for open invoice" |
1489 | +- |
1490 | + I check move line is created with proper data. |
1491 | +- |
1492 | + !python {model: account.invoice}: | |
1493 | + invoice = self.browse(cr, uid, ref("account_invoice_0")) |
1494 | + |
1495 | + assert invoice.move_id.journal_id == invoice.journal_id, "journal is not created properly" |
1496 | + assert invoice.move_id.name == invoice.number, "journal number is not created properly" |
1497 | + assert invoice.move_id.period_id == invoice.period_id, "period is not created properly" |
1498 | + assert invoice.move_id.state == 'posted', "Move state is not posted" |
1499 | + assert invoice.move_id.line_id, "Move lines not created for invoice" |
1500 | + assert invoice.partner_id.credit == invoice.amount_total, "proper amount is not credit into partner account " |
1501 | + assert len(invoice.move_id.line_id) == 1+len(invoice.invoice_line)+len(invoice.tax_line), "move line is not proper created" |
1502 | + |
1503 | + assert (invoice.amount_total - invoice.amount_tax), "untax amount is not set proper" |
1504 | + assert (invoice.amount_total + invoice.amount_tax), "residual amount is not set proper" |
1505 | + |
1506 | + move_line = invoice.move_id.line_id[0] |
1507 | + assert move_line.state == 'valid', "Move line state is not valid" |
1508 | + |
1509 | + assert invoice.date_due, "due date is is not created for open invoice" |
1510 | + assert move_line.date_maturity == invoice.date_due, "due date is not created properly" |
1511 | + |
1512 | + if move_line.account_id == invoice.account_id: |
1513 | + assert move_line.debit == invoice.amount_total and move_line.credit == 0, "proper amount is not debit to account " |
1514 | + |
1515 | + i = 1 |
1516 | + for tax_line in invoice.tax_line: |
1517 | + move_line = invoice.move_id.line_id[i] |
1518 | + assert move_line.account_id == tax_line.account_id, "account is not created properly" |
1519 | + assert move_line.credit == tax_line.amount, "proper amount is not credit to tax account" |
1520 | + assert move_line.debit == 0, "proper amount is not debit to tax account" |
1521 | + i +=1 |
1522 | + for invoice_line in invoice.invoice_line: |
1523 | + move_line = invoice.move_id.line_id[i] |
1524 | + assert move_line.account_id == invoice_line.account_id, "account is not created properly" |
1525 | + #assert move_line.credit == invoice_line.price_subtotal, "proper amount is not credit to account" |
1526 | + assert move_line.debit == 0, "proper amount is not debit to account" |
1527 | + i +=1 |
1528 | +- |
1529 | + I make a reconcile entries of customer invoice. |
1530 | +- |
1531 | + !python {model: account.move.line.reconcile}: | |
1532 | + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_0")) |
1533 | + move_line = invoice.move_id.line_id[0] |
1534 | + |
1535 | + context = {'active_ids': [move_line.id], "active_model": 'account.move.line'} |
1536 | + reconcile_wiz_id = self.create(cr, uid, {}, context=context) |
1537 | + self.trans_rec_addendum_writeoff(cr, uid, [reconcile_wiz_id], context=context) |
1538 | + |
1539 | + writeoff_obj = self.pool.get('account.move.line.reconcile.writeoff') |
1540 | + writeoff_datas={ |
1541 | + 'journal_id': ref("cash_journal"), |
1542 | + 'writeoff_acc_id': ref("cash"), |
1543 | + } |
1544 | + write_off_id = writeoff_obj.create(cr, uid, writeoff_datas) |
1545 | + writeoff_obj.trans_rec_reconcile(cr, uid, [write_off_id], context=context) |
1546 | +- |
1547 | + I check that the Invoice reconcile Proper. |
1548 | +- |
1549 | + !python {model: account.invoice}: | |
1550 | + invoice = self.browse(cr, uid, ref("account_invoice_0")) |
1551 | + assert invoice.reconciled == True, "the invoice is not reconciled." |
1552 | + assert invoice.state == 'paid', "Invoice state is not paid." |
1553 | + assert invoice.residual == 0.0, "The residual amount is not fully paid." |
1554 | +- |
1555 | + I check that the payment amount is credited with proper data. |
1556 | +- |
1557 | + !python {model: account.invoice}: | |
1558 | + invoice = self.browse(cr, uid, ref("account_invoice_0")) |
1559 | + payment_line = invoice.payment_ids[0] |
1560 | + assert payment_line, "payment line not created for paid invoice" |
1561 | + assert payment_line.state == 'valid', "payment move line state is not valid" |
1562 | + assert payment_line.debit == 0.0 and payment_line.credit == invoice.amount_total, "proper amount is not debit to payment account " |
1563 | + |
1564 | + assert payment_line.reconcile_id, "reconcile is not created for paid invoice" |
1565 | +- |
1566 | + I make a unreconcile entries of customer invoice. |
1567 | +- |
1568 | + !python {model: account.unreconcile}: | |
1569 | + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_0")) |
1570 | + move_line = invoice.move_id.line_id[0] |
1571 | + |
1572 | + context = {'active_ids': [move_line.id], "active_model": 'account.move.line'} |
1573 | + unreconcile_wiz_id = self.create(cr, uid, {}, context=context) |
1574 | + self.trans_unrec(cr, uid, [unreconcile_wiz_id], context=context) |
1575 | +- |
1576 | + I check that the reconcile is now False. |
1577 | +- |
1578 | + !assert {model: account.invoice, id: account_invoice_0}: |
1579 | + - reconciled == False |
1580 | +- |
1581 | + I check that the unreconcile a entries of customer is done with proper data. |
1582 | +- |
1583 | + !python {model: account.invoice}: | |
1584 | + invoice = self.browse(cr, uid, ref("account_invoice_0")) |
1585 | + move_line = invoice.move_id.line_id[0] |
1586 | + assert (not move_line.reconcile_id), "reconcile line should created after unreconcile a invoice" |
1587 | + assert (not invoice.payment_ids), "payment line should created after unreconcile a invoice" |
1588 | +- |
1589 | + Reopen a customer invoice. |
1590 | +- |
1591 | + !python {model: account.state.open}: | |
1592 | + new_id = self.create(cr ,uid ,{}) |
1593 | + self.change_inv_state(cr, uid, [new_id], {"active_ids": [ref("account_invoice_0")]}) |
1594 | +- |
1595 | + I check that the invoice is in "Open" state. |
1596 | +- |
1597 | + !assert {model: account.invoice, id: account_invoice_0}: |
1598 | + - state == 'open' |
1599 | +- |
1600 | + I refund an Invoice. |
1601 | +- |
1602 | + !python {model: account.invoice.refund}: | |
1603 | + new_id = self.create(cr ,uid ,{'description': 'Refund To Axelor'}) |
1604 | + self.invoice_refund(cr, uid, [new_id], {"active_ids": [ref("account_invoice_0")]}) |
1605 | +- |
1606 | + I checked that a new entry is created for refund invoice. |
1607 | +- |
1608 | + !python {model: account.invoice}: | |
1609 | + invoice_refund = self.pool.get('account.invoice').search(cr, uid, [('name', '=', 'Refund To Axelor')]) |
1610 | + assert invoice_refund, "customer refund invoice record is not created" |
1611 | + |
1612 | + invoice = self.pool.get('account.invoice').browse(cr, uid, invoice_refund)[0] |
1613 | + |
1614 | + assert invoice.invoice_line[0].account_id.id == ref("a_sale"), "account is not created properly" |
1615 | + assert invoice.invoice_line[0].product_id.id == ref("product.product_product_hdd1"), "product is not created properly" |
1616 | + assert invoice.invoice_line[0].price_subtotal == 503.3, "sub total is not created properly" |
1617 | + assert invoice.invoice_line[1].product_id.id == ref("product.product_product_employee0"), "product is not created properly" |
1618 | + assert invoice.invoice_line[1].price_subtotal == 882.0, "sub total is not created properly" |
1619 | |
1620 | === renamed file 'account/test/account_fiscalyear_close.yml' => 'account/test/opening_entries.yml' |
1621 | --- account/test/account_fiscalyear_close.yml 2011-10-16 01:28:00 +0000 |
1622 | +++ account/test/opening_entries.yml 2012-08-24 13:00:40 +0000 |
1623 | @@ -1,93 +1,34 @@ |
1624 | - |
1625 | - In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear to which the entries will move |
1626 | -- |
1627 | - !record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}: |
1628 | - code: !eval "'FY%s'% (datetime.now().year+1)" |
1629 | - company_id: base.main_company |
1630 | - date_start: !eval "'%s-01-01' %(datetime.now().year+1)" |
1631 | - date_stop: !eval "'%s-12-31' %(datetime.now().year+1)" |
1632 | - name: !eval "'Fiscal Year %s' %(datetime.now().year+1)" |
1633 | -- |
1634 | - I create a period for the opening entries for the new fiscalyear |
1635 | -- |
1636 | - !record {model: account.period, id: account_period_jan11}: |
1637 | - company_id: base.main_company |
1638 | - date_start: !eval "'%s-01-01'% (datetime.now().year+1)" |
1639 | - date_stop: !eval "'%s-01-01'% (datetime.now().year+1)" |
1640 | - fiscalyear_id: account_fiscalyear_fiscalyear0 |
1641 | - name: !eval "'OP %s' %(datetime.now().year+1)" |
1642 | - special: 1 |
1643 | - |
1644 | -- |
1645 | - I made modification in journal so it can move entries |
1646 | -- |
1647 | - !record {model: account.journal, id: account.close_journal}: |
1648 | - name: End of Year |
1649 | - code: NEW |
1650 | - type: situation |
1651 | - analytic_journal_id: sit |
1652 | - default_debit_account_id: cash |
1653 | - default_credit_account_id: cash |
1654 | - company_id: base.main_company |
1655 | - view_id: account_journal_bank_view |
1656 | - centralisation: 1 |
1657 | -- |
1658 | - I called the Generate Fiscalyear Opening Entries wizard |
1659 | + In order to test the opening entries of account, |
1660 | +- |
1661 | + I generate a new Opening Entries. |
1662 | - |
1663 | !record {model: account.fiscalyear.close, id: account_fiscalyear_close_0}: |
1664 | - fy2_id: account_fiscalyear_fiscalyear0 |
1665 | + fy2_id: account.data_fiscalyear2 |
1666 | fy_id: account.data_fiscalyear |
1667 | - journal_id: account.close_journal |
1668 | - period_id: account_period_jan11 |
1669 | + journal_id: account.opening_journal |
1670 | + period_id: account.period_for_fiscalyear2 |
1671 | report_name: End of Fiscal Year Entry |
1672 | - |
1673 | - I clicked on create Button |
1674 | - |
1675 | -- |
1676 | !python {model: account.fiscalyear.close}: | |
1677 | - self.data_save(cr, uid, [ref("account_fiscalyear_close_0")], {"lang": 'en_US', |
1678 | - "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_fy_close")], |
1679 | - "tz": False, "active_id": ref("account.menu_wizard_fy_close"), }) |
1680 | - |
1681 | + self.data_save(cr, uid, [ref("account_fiscalyear_close_0")]) |
1682 | - |
1683 | - I check the opening entries By using "Entries by Line wizard" |
1684 | + I check the opening entries. |
1685 | - |
1686 | !record {model: account.move.journal, id: account_move_journal_0}: |
1687 | {} |
1688 | - |
1689 | - I clicked on Open Journal Button to check the entries |
1690 | - |
1691 | + In order to check the entries, I Open Journal. |
1692 | - |
1693 | !python {model: account.move.journal}: | |
1694 | - self.action_open_window(cr, uid, [ref("account_move_journal_0")], {"lang": 'en_US', |
1695 | - "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")], |
1696 | - "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"), |
1697 | - }) |
1698 | - |
1699 | -#- |
1700 | -# In order to test Cancel Opening Entries I cancelled the opening entries created for "Fiscal Year 2011" |
1701 | -#- |
1702 | -# !record {model: account.open.closed.fiscalyear, id: account_open_closed_fiscalyear_1}: |
1703 | -# fyear_id: account.data_fiscalyear |
1704 | -#- |
1705 | -# I clicked on Open button |
1706 | -#- |
1707 | -# !python {model: account.open.closed.fiscalyear}: | |
1708 | -# self.remove_entries(cr, uid, [ref("account_open_closed_fiscalyear_1")], {"lang": |
1709 | -# 'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_open_closed_fy")], |
1710 | -# "tz": False, "active_id": ref("account.menu_wizard_open_closed_fy"), }) |
1711 | -#- |
1712 | -# I check the opening entries By using "Entries by Line wizard" |
1713 | -#- |
1714 | -# !record {model: account.move.journal, id: account_move_journal_2}: |
1715 | -# journal_id: account.sales_journal |
1716 | -# period_id: account_period_jan11 |
1717 | -# |
1718 | -#- |
1719 | -# I checked the Opening entries are cancelled successfully |
1720 | -#- |
1721 | -# !python {model: account.move.journal}: | |
1722 | -# self.action_open_window(cr, uid, [ref("account_move_journal_2")], {"lang": 'en_US', |
1723 | -# "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")], |
1724 | -# "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"), |
1725 | -# }) |
1726 | + self.action_open_window(cr, uid, [ref("account_move_journal_0")]) |
1727 | +- |
1728 | + In order to test Cancel Opening Entries, I cancelled the opening entries created for last year. |
1729 | +- |
1730 | + !record {model: account.open.closed.fiscalyear, id: account_open_closed_fiscalyear_1}: |
1731 | + fyear_id: account.data_fiscalyear |
1732 | +- |
1733 | + I remove a entries. |
1734 | +- |
1735 | + !python {model: account.open.closed.fiscalyear}: | |
1736 | + self.remove_entries(cr, uid, [ref("account_open_closed_fiscalyear_1")]) |
1737 | |
1738 | === removed file 'account/test/price_accuracy00.yml' |
1739 | --- account/test/price_accuracy00.yml 2012-06-29 11:04:24 +0000 |
1740 | +++ account/test/price_accuracy00.yml 1970-01-01 00:00:00 +0000 |
1741 | @@ -1,93 +0,0 @@ |
1742 | -- | |
1743 | - Tax Scenario: |
1744 | - In order to check that the accounting entries and tax engine works |
1745 | - efficiently with all kind of price accuracies we run this test scenario. |
1746 | -- |
1747 | - Given the price accuracy for the account module is configured with two |
1748 | - digits |
1749 | -- |
1750 | - !record {model: decimal.precision, id: product.decimal_account}: |
1751 | - digits: 2 |
1752 | -- |
1753 | - And we have a tax defined |
1754 | -- |
1755 | - !record {model: account.tax, id: tax196}: |
1756 | - name: Tax 19.6% |
1757 | - amount: &tax 0.196 |
1758 | -- |
1759 | - And we define an invoice with one invoice line with a tax of *tax |
1760 | -- |
1761 | - !record {model: account.invoice, id: invoice1}: &invoice |
1762 | - name: Precision Test |
1763 | - type: out_invoice |
1764 | - partner_id: base.res_partner_2 |
1765 | - account_id: account.a_recv |
1766 | - date_invoice: !eval time.strftime('%Y-%m-%d') |
1767 | - invoice_line: |
1768 | - - product_id: product.product_product_3 |
1769 | - quantity: &qty 11.11 |
1770 | - account_id: account.a_sale |
1771 | - uos_id: product.product_uom_unit |
1772 | - price_unit: &price 12.34 |
1773 | - name: test |
1774 | - invoice_line_tax_id: |
1775 | - - tax196 |
1776 | -- |
1777 | - When I press on the CREATE button on the invoice to open it. |
1778 | -- |
1779 | - !python {model: account.invoice}: | |
1780 | - self.action_move_create(cr, uid, [ref("invoice1")]) |
1781 | -- |
1782 | - Then I should see an account entry linked to this invoice. |
1783 | -- |
1784 | - !assert {model: account.invoice, id: invoice1}: |
1785 | - test: |
1786 | - - bool(move_id) |
1787 | -- |
1788 | - # This is not working, find a way to do that in YAML, *qty is not |
1789 | - # interpreted because it's not a node. |
1790 | - And this account entry must have a credit equals to 163.97€ which is |
1791 | - equal to *qty x *price x (1 + *tax) |
1792 | -- |
1793 | - !assert {model: account.invoice, id: invoice1}: |
1794 | - test: |
1795 | - - abs(sum(x.credit for x in move_id.line_id) - 163.97) < 0.000001 |
1796 | -- |
1797 | - And this account entry must have a credit equals to the debit |
1798 | -- |
1799 | - !assert {model: account.invoice, id: invoice1}: |
1800 | - test: |
1801 | - - abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001 |
1802 | -- |
1803 | - Then, I change the precision of numbers to 3 digits. |
1804 | -- |
1805 | - !record {model: decimal.precision, id: product.decimal_account}: |
1806 | - digits: 3 |
1807 | -- |
1808 | - And I create another invoice with the same content. |
1809 | -- |
1810 | - !record {model: account.invoice, id: invoice2}: |
1811 | - *invoice |
1812 | -- |
1813 | - When I press on the CREATE button on the invoice to open it. |
1814 | -- |
1815 | - !python {model: account.invoice}: | |
1816 | - self.action_move_create(cr, uid, [ref("invoice2")]) |
1817 | -- |
1818 | - Then this account entry must have a credit equals to the debit |
1819 | -- |
1820 | - !assert {model: account.invoice, id: invoice2}: |
1821 | - test: |
1822 | - - abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001 |
1823 | -- |
1824 | - And this account entry must have a credit equals to 163.968€ which is |
1825 | - equal to *qty x *price x (1 + *tax) |
1826 | -- |
1827 | - !python {model: account.invoice}: | |
1828 | - xid = "invoice2" |
1829 | - invoice = self.browse(cr, uid, ref(xid)) |
1830 | - sum_of_credits = sum(x.credit for x in invoice.move_id.line_id) |
1831 | - log("The sum of credits for %s is %f", xid, sum_of_credits) |
1832 | - expected_value = 163.968 |
1833 | - assert (sum_of_credits - expected_value) < 0.000001, "Wrong sum of credits: %f <> %f" % (sum_of_credits, expected_value) |
1834 | - |
1835 | |
1836 | === added file 'account/test/test_bank_cash_statement.yml' |
1837 | --- account/test/test_bank_cash_statement.yml 1970-01-01 00:00:00 +0000 |
1838 | +++ account/test/test_bank_cash_statement.yml 2012-08-24 13:00:40 +0000 |
1839 | @@ -0,0 +1,91 @@ |
1840 | +- |
1841 | + In order to test Bank Statement feature of account, |
1842 | +- |
1843 | + I modify the bank statement and set the Closing Balance. |
1844 | +- |
1845 | + !python {model: account.bank.statement}: | |
1846 | + self.write(cr, uid, [ref('account.account_bank_statement_0')], {'balance_end_real': 1000}) |
1847 | +- |
1848 | + I confirm the bank statement. |
1849 | +- |
1850 | + !python {model: account.bank.statement}: | |
1851 | + self.button_confirm_bank(cr, uid, [ref("account.account_bank_statement_0")]) |
1852 | +- |
1853 | + I check that bank statement is now "Closed". |
1854 | +- |
1855 | + !assert {model: account.bank.statement, id: account.account_bank_statement_0}: |
1856 | + - state == 'confirm' |
1857 | +- |
1858 | + I check that move lines created for bank statement and move state is Posted. |
1859 | +- |
1860 | + !python {model: account.bank.statement}: | |
1861 | + bank_data = self.browse(cr, uid, ref("account.account_bank_statement_0")) |
1862 | + move_line = bank_data.move_line_ids[0] |
1863 | + bank_line = bank_data.line_ids[0] |
1864 | + move_line1 = bank_data.move_line_ids[1] |
1865 | + |
1866 | + assert bank_data.move_line_ids, "Move lines not created for bank statement" |
1867 | + assert move_line.state == 'valid', "Move state is not posted" |
1868 | + assert move_line.move_id.state == 'posted', "Move state is not posted" |
1869 | + assert move_line.journal_id == bank_data.journal_id, "journal is not same created" |
1870 | + assert move_line.statement_id.name == bank_data.name, "bank sequence number is not same created" |
1871 | + assert move_line.account_id == bank_data.journal_id.default_credit_account_id, " account is not same created" |
1872 | + assert move_line.partner_id == bank_line.partner_id, "partner is not same created" |
1873 | + assert move_line.debit == bank_data.balance_end_real, "proper amount is not debit in bank account" |
1874 | + assert move_line1.credit == bank_data.balance_end_real, "proper amount is not credit in bank account" |
1875 | + assert move_line1.account_id == bank_line.account_id, "account is not same created" |
1876 | + |
1877 | +- |
1878 | + I cancel Bank Statements and verifies that It raises a warning. |
1879 | +- |
1880 | + !python {model: account.bank.statement}: | |
1881 | + try: |
1882 | + self.button_cancel(cr, uid, [ref("account.account_bank_statement_0")]) |
1883 | + except Exception, e: |
1884 | + assert e[0]=='UserError', 'Another exception has been raised!' |
1885 | +- |
1886 | + In order to test Cash statement, |
1887 | +- |
1888 | + I check that Initially bank statement is in the "Draft" state. |
1889 | +- |
1890 | + !assert {model: account.bank.statement, id: account_bank_statement_1}: |
1891 | + - state == 'draft' |
1892 | +- |
1893 | + I open the cashbox. |
1894 | +- |
1895 | + !python {model: account.bank.statement}: | |
1896 | + self.button_open(cr, uid, [ref("account.account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account.account_bank_statement_1")], "active_id": ref("account.account_bank_statement_1"), }) |
1897 | +- |
1898 | + I check that now bank statement is in the "Open" state. |
1899 | +- |
1900 | + !assert {model: account.bank.statement, id: account_bank_statement_1}: |
1901 | + - state == 'open' |
1902 | +- |
1903 | + I close the cashbox. |
1904 | +- |
1905 | + !python {model: account.bank.statement}: | |
1906 | + self.button_confirm_cash(cr, uid, [ref("account.account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account.account_bank_statement_1")], "active_id": ref("account.account_bank_statement_1"), }) |
1907 | +- |
1908 | + I check that bank statement is now "Closed". |
1909 | +- |
1910 | + !assert {model: account.bank.statement, id: account.account_bank_statement_1}: |
1911 | + - state == 'confirm' |
1912 | +- |
1913 | + I check that move lines created for bank statement and move state is Posted. |
1914 | +- |
1915 | + !python {model: account.bank.statement}: | |
1916 | + bank_data = self.browse(cr, uid, ref("account.account_bank_statement_1")) |
1917 | + move_line = bank_data.move_line_ids[0] |
1918 | + bank_line = bank_data.line_ids[0] |
1919 | + move_line1 = bank_data.move_line_ids[1] |
1920 | + |
1921 | + assert bank_data.move_line_ids, "Move lines not created for bank statement" |
1922 | + assert move_line.state == 'valid', "Move state is not posted" |
1923 | + assert move_line.move_id.state == 'posted', "Move state is not posted" |
1924 | + assert move_line.journal_id == bank_data.journal_id, "journal is not same created" |
1925 | + assert move_line.statement_id.name == bank_data.name, "bank sequence number is not same created" |
1926 | + assert move_line.account_id == bank_data.journal_id.default_credit_account_id, " account is not same created" |
1927 | + assert move_line.partner_id == bank_line.partner_id, "partner is not same created" |
1928 | + assert move_line.debit == bank_data.total_entry_encoding, "proper amount is not debit in bank account" |
1929 | + assert move_line1.credit == bank_data.total_entry_encoding, "proper amount is not credit in bank account" |
1930 | + assert move_line1.account_id == bank_line.account_id, "account is not same created" |
1931 | |
1932 | === modified file 'account/test/test_edi_invoice.yml' |
1933 | --- account/test/test_edi_invoice.yml 2012-08-16 08:42:24 +0000 |
1934 | +++ account/test/test_edi_invoice.yml 2012-08-24 13:00:40 +0000 |
1935 | @@ -1,68 +1,35 @@ |
1936 | - |
1937 | - In order to test the EDI export features of Invoices |
1938 | -- |
1939 | - First I create a draft customer invoice |
1940 | -- |
1941 | - !record {model: account.invoice, id: invoice_edi_1}: |
1942 | - journal_id: 1 |
1943 | - partner_id: base.res_partner_2 |
1944 | - currency_id: base.EUR |
1945 | - company_id: 1 |
1946 | - account_id: account.a_pay |
1947 | - date_invoice: !eval "'%s' % (time.strftime('%Y-%m-%d'))" |
1948 | - name: selling product |
1949 | - type: 'out_invoice' |
1950 | - invoice_line: |
1951 | - - product_id: product.product_product_3 |
1952 | - uos_id: 1 |
1953 | - quantity: 1.0 |
1954 | - price_unit: 10.0 |
1955 | - name: 'basic pc' |
1956 | - account_id: account.a_pay |
1957 | - invoice_line: |
1958 | - - product_id: product.product_product_5 |
1959 | - uos_id: 1 |
1960 | - quantity: 5.0 |
1961 | - price_unit: 100.0 |
1962 | - name: 'PC on Demand' |
1963 | - account_id: account.a_pay |
1964 | - tax_line: |
1965 | - - name: sale tax |
1966 | - account_id: account.a_pay |
1967 | - manual: True |
1968 | - amount: 1000.00 |
1969 | -- |
1970 | - I confirm and open the invoice |
1971 | -- |
1972 | - !workflow {model: account.invoice, ref: invoice_edi_1, action: invoice_open} |
1973 | -- |
1974 | - Then I export the customer invoice |
1975 | + In order to test the EDI export features of Invoices, |
1976 | +- |
1977 | + I confirm and open the invoice. |
1978 | +- |
1979 | + !workflow {model: account.invoice, ref: demo_invoice_0, action: invoice_open} |
1980 | +- |
1981 | + I export the customer invoice. |
1982 | - |
1983 | !python {model: edi.document}: | |
1984 | invoice_pool = self.pool.get('account.invoice') |
1985 | - invoice = invoice_pool.browse(cr, uid, ref("invoice_edi_1")) |
1986 | + invoice = invoice_pool.browse(cr, uid, ref("demo_invoice_0")) |
1987 | token = self.export_edi(cr, uid, [invoice]) |
1988 | assert token, 'Invalid EDI Token' |
1989 | - |
1990 | - Then I import a sample EDI document of another customer invoice |
1991 | + I import a sample EDI document of another customer invoice. |
1992 | - |
1993 | !python {model: account.invoice}: | |
1994 | - import time |
1995 | edi_document = { |
1996 | "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms", |
1997 | "__module": "account", |
1998 | "__model": "account.invoice", |
1999 | "__version": [6,1,0], |
2000 | - "internal_number": time.strftime("SAJ/%Y/002"), |
2001 | + "internal_number": "SAJ/2011/002", |
2002 | "company_address": { |
2003 | "__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.main_address", |
2004 | "__module": "base", |
2005 | - "__model": "res.partner", |
2006 | - "city": "Gerompont", |
2007 | - "name": "Company main address", |
2008 | - "zip": "1367", |
2009 | - "country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"], |
2010 | - "phone": "(+32).81.81.37.00", |
2011 | + "__model": "res.partner.address", |
2012 | + "city": "Gerompont", |
2013 | + "zip": "1367", |
2014 | + "country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"], |
2015 | + "phone": "(+32).81.81.37.00", |
2016 | "street": "Chaussee de Namur 40", |
2017 | "bank_ids": [ |
2018 | ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_bank-ZrTWzesfsdDJzGbp","Sample bank: 123465789-156113"] |
2019 | @@ -80,15 +47,14 @@ |
2020 | "partner_address": { |
2021 | "__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_address_7wdsjasdjh", |
2022 | "__module": "base", |
2023 | - "__model": "res.partner", |
2024 | - "name": "Default Address", |
2025 | - "phone": "(+32).81.81.37.00", |
2026 | - "street": "Chaussee de Namur 40", |
2027 | - "city": "Gerompont", |
2028 | - "zip": "1367", |
2029 | - "country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"], |
2030 | + "__model": "res.partner.address", |
2031 | + "phone": "(+32).81.81.37.00", |
2032 | + "street": "Chaussee de Namur 40", |
2033 | + "city": "Gerompont", |
2034 | + "zip": "1367", |
2035 | + "country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"], |
2036 | }, |
2037 | - "date_invoice": time.strftime('%Y-%m-%d'), |
2038 | + "date_invoice": "2011-06-22", |
2039 | "name": "sample invoice", |
2040 | "tax_line": [{ |
2041 | "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl", |
2042 | @@ -103,20 +69,20 @@ |
2043 | "__module": "account", |
2044 | "__model": "account.invoice.line", |
2045 | "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-1RP3so", |
2046 | - "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "Unit"], |
2047 | - "name": "PC Assemble SC234", |
2048 | + "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"], |
2049 | + "name": "Basic PC", |
2050 | "price_unit": 10.0, |
2051 | - "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_3", "[PCSC234] PC Assemble SC234"], |
2052 | + "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc1", "[PC1] Basic PC"], |
2053 | "quantity": 1.0 |
2054 | }, |
2055 | { |
2056 | "__module": "account", |
2057 | "__model": "account.invoice.line", |
2058 | "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-u2XV5", |
2059 | - "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "Unit"], |
2060 | - "name": "PC on Demand", |
2061 | + "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"], |
2062 | + "name": "Medium PC", |
2063 | "price_unit": 100.0, |
2064 | - "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_5", "[PC-DEM] PC on Demand"], |
2065 | + "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc3", "[PC3] Medium PC"], |
2066 | "quantity": 5.0 |
2067 | }] |
2068 | } |
2069 | @@ -130,7 +96,7 @@ |
2070 | assert bank_info.acc_number == "Sample bank: 123465789-156113", 'Expected "Sample bank: 123465789-156113", got %s' % bank_info.acc_number |
2071 | |
2072 | assert invoice_new.partner_id.supplier, 'Imported Partner is not marked as supplier' |
2073 | - assert invoice_new.reference == time.strftime("SAJ/%Y/002"), "internal number is not stored in reference" |
2074 | + assert invoice_new.reference == "SAJ/2011/002", "internal number is not stored in reference" |
2075 | assert invoice_new.reference_type == 'none', "reference type is not set to 'none'" |
2076 | assert invoice_new.internal_number == False, "internal number is not reset" |
2077 | assert invoice_new.journal_id.id, "journal id is not selected" |
2078 | |
2079 | === added file 'account/test/test_fiscalyear_process.yml' |
2080 | --- account/test/test_fiscalyear_process.yml 1970-01-01 00:00:00 +0000 |
2081 | +++ account/test/test_fiscalyear_process.yml 2012-08-24 13:00:40 +0000 |
2082 | @@ -0,0 +1,46 @@ |
2083 | +- |
2084 | + In order to test process of close a period of fiscalyear, |
2085 | +- |
2086 | + I make a record to close period of fiscalyear |
2087 | +- |
2088 | + !record {model: account.period.close, id: account_period_close_0}: |
2089 | + sure: 1 |
2090 | +- |
2091 | + I close Period of fiscalyear. |
2092 | +- |
2093 | + !python {model: account.period.close}: | |
2094 | + self.data_save(cr, uid, [ref("account_period_close_0")], {"active_model": |
2095 | + "account.period", "active_ids": [ref("period_1")], "active_id": |
2096 | + ref("period_1"), }) |
2097 | +- |
2098 | + I check that the period is in "Done" state. |
2099 | +- |
2100 | + !assert {model: account.period, id: period_1, string: Period should in Done state}: |
2101 | + - state == 'done' |
2102 | +- |
2103 | + I create monthly periods for fiscalyear |
2104 | +- |
2105 | + !python {model: account.fiscalyear}: | |
2106 | + self.create_period(cr, uid, [ref("data_fiscalyear")], {"active_model": "ir.ui.menu", "active_ids": [ref("menu_action_account_fiscalyear_form")], |
2107 | + "active_id": ref("menu_action_account_fiscalyear_form"), |
2108 | + }) |
2109 | +- |
2110 | + I check that the fiscalyear is in "Draft" state. |
2111 | +- |
2112 | + !assert {model: account.fiscalyear, id: account.data_fiscalyear}: |
2113 | + - state == 'draft' |
2114 | +- |
2115 | + I close the fiscalyear. |
2116 | +- |
2117 | + !record {model: account.fiscalyear.close.state, id: account_fiscalyear_close_state_0}: |
2118 | + fy_id: data_fiscalyear |
2119 | +- |
2120 | + !python {model: account.fiscalyear.close.state}: | |
2121 | + self.data_save(cr, uid, [ref("account_fiscalyear_close_state_0")], { |
2122 | + "active_model": "ir.ui.menu", "active_ids": [ref("menu_wizard_fy_close_state")], |
2123 | + "active_id": ref("menu_wizard_fy_close_state"), }) |
2124 | +- |
2125 | + I check that the fiscalyear is in "Done" state. |
2126 | +- |
2127 | + !assert {model: account.fiscalyear, id: data_fiscalyear, string: Fiscal Year should in Done state}: |
2128 | + - state == 'done' |
2129 | |
2130 | === removed file 'account/test/test_parent_structure.py' |
2131 | --- account/test/test_parent_structure.py 2011-12-19 16:54:40 +0000 |
2132 | +++ account/test/test_parent_structure.py 1970-01-01 00:00:00 +0000 |
2133 | @@ -1,51 +0,0 @@ |
2134 | -# -*- coding: utf-8 -*- |
2135 | -############################################################################## |
2136 | -# |
2137 | -# OpenERP, Open Source Management Solution |
2138 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
2139 | -# |
2140 | -# This program is free software: you can redistribute it and/or modify |
2141 | -# it under the terms of the GNU Affero General Public License as |
2142 | -# published by the Free Software Foundation, either version 3 of the |
2143 | -# License, or (at your option) any later version. |
2144 | -# |
2145 | -# This program is distributed in the hope that it will be useful, |
2146 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2147 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2148 | -# GNU Affero General Public License for more details. |
2149 | -# |
2150 | -# You should have received a copy of the GNU Affero General Public License |
2151 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2152 | -# |
2153 | -############################################################################## |
2154 | - |
2155 | -# |
2156 | -# TODO: move this in a YAML test with !python tag |
2157 | -# |
2158 | - |
2159 | -import xmlrpclib |
2160 | - |
2161 | -DB = 'training3' |
2162 | -USERID = 1 |
2163 | -USERPASS = 'admin' |
2164 | - |
2165 | - |
2166 | -sock = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/object' % ('localhost',8069)) |
2167 | - |
2168 | -ids = sock.execute(DB, USERID, USERPASS, 'account.account', 'search', [], {}) |
2169 | -account_lists = sock.execute(DB, USERID, USERPASS, 'account.account', 'read', ids, ['parent_id','parent_left','parent_right']) |
2170 | - |
2171 | -accounts = dict(map(lambda x: (x['id'],x), account_lists)) |
2172 | -for a in account_lists: |
2173 | - if a['parent_id']: |
2174 | - assert a['parent_left'] > accounts[a['parent_id'][0]]['parent_left'] |
2175 | - assert a['parent_right'] < accounts[a['parent_id'][0]]['parent_right'] |
2176 | - assert a['parent_left'] < a['parent_right'] |
2177 | - for a2 in account_lists: |
2178 | - assert not ((a2['parent_right']>a['parent_left']) and |
2179 | - (a2['parent_left']<a['parent_left']) and |
2180 | - (a2['parent_right']<a['parent_right'])) |
2181 | - if a2['parent_id']==a['id']: |
2182 | - assert (a2['parent_left']>a['parent_left']) and (a2['parent_right']<a['parent_right']) |
2183 | - |
2184 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2185 | |
2186 | === modified file 'account/test/test_parent_structure.yml' |
2187 | --- account/test/test_parent_structure.yml 2011-01-14 00:11:01 +0000 |
2188 | +++ account/test/test_parent_structure.yml 2012-08-24 13:00:40 +0000 |
2189 | @@ -1,6 +1,6 @@ |
2190 | - |
2191 | We retrieve all accounts and test that those are in a tree data structure. |
2192 | -- |
2193 | +- |
2194 | !python {model: account.account}: | |
2195 | ids = self.search(cr, uid, []) |
2196 | accounts_list = self.read(cr, uid, ids, ['parent_id','parent_left','parent_right']) |
2197 | @@ -12,9 +12,8 @@ |
2198 | assert a['parent_right'] < accounts[a['parent_id'][0]]['parent_right'] |
2199 | assert a['parent_left'] < a['parent_right'] |
2200 | for a2 in accounts_list: |
2201 | - assert not ((a2['parent_right'] > a['parent_left']) and |
2202 | - (a2['parent_left'] < a['parent_left']) and |
2203 | + assert not ((a2['parent_right'] > a['parent_left']) and |
2204 | + (a2['parent_left'] < a['parent_left']) and |
2205 | (a2['parent_right'] < a['parent_right'])) |
2206 | if a2['parent_id']==a['id']: |
2207 | assert (a2['parent_left'] > a['parent_left']) and (a2['parent_right'] < a['parent_right']) |
2208 | - |
2209 | |
2210 | === added file 'account/test/test_recurring_entries.yml' |
2211 | --- account/test/test_recurring_entries.yml 1970-01-01 00:00:00 +0000 |
2212 | +++ account/test/test_recurring_entries.yml 2012-08-24 13:00:40 +0000 |
2213 | @@ -0,0 +1,36 @@ |
2214 | +- |
2215 | + In order to test the Automatically generate entries, |
2216 | +- |
2217 | + Generate entries. |
2218 | +- |
2219 | + !python {model: account.subscription.generate}: | |
2220 | + import time |
2221 | + new_id = self.create(cr ,uid ,{'date': time.strftime('%Y-%m-%d %H:%M:%S')}) |
2222 | + self.action_generate(cr, uid, [new_id]) |
2223 | +- |
2224 | + In order to test a manual recurring entries, I create a record for particular journal. |
2225 | +- |
2226 | + !record {model: account.model, id: account_model_mymodelonyears0}: |
2227 | + journal_id: expenses_journal |
2228 | + lines_id: |
2229 | + - account_id: a_recv |
2230 | + debit: 100.0 |
2231 | + name: model_line_db |
2232 | + sequence: 0.0 |
2233 | + partner_id: base.res_partner_3 |
2234 | + - account_id: a_pay |
2235 | + credit: 100.0 |
2236 | + name: model_line_cr |
2237 | + sequence: 0.0 |
2238 | + partner_id: base.res_partner_3 |
2239 | + name: My Test Model |
2240 | +- |
2241 | + I create a manual entries. |
2242 | +- |
2243 | + !python {model: account.use.model}: | |
2244 | + new_id = self.create(cr ,uid ,{}) |
2245 | + self.create_entries(cr, uid, [new_id], {"active_model": |
2246 | + "account.model", "active_ids": [ref("account_model_mymodelonyears0")], "active_id": ref("account_model_mymodelonyears0")}) |
2247 | + move_obj = self.pool.get('account.move') |
2248 | + ids = move_obj.search(cr, uid, [('ref', '=', 'My Test Model')]) |
2249 | + assert len(ids), "Error:moves not created for model 'My Test Model'" |
2250 | |
2251 | === renamed file 'account/test/account_validate_account_move.yml' => 'account/test/validate_account_move.yml' |
2252 | --- account/test/account_validate_account_move.yml 2012-06-20 12:03:05 +0000 |
2253 | +++ account/test/validate_account_move.yml 2012-08-24 13:00:40 +0000 |
2254 | @@ -1,113 +1,47 @@ |
2255 | - |
2256 | - In order to test the account move lines in OpenERP, I create account move |
2257 | -- |
2258 | - I create a Account tax code |
2259 | + I create a record for a account tax code. |
2260 | - |
2261 | !record {model: account.tax.code, id: account_tax_code_0}: |
2262 | name : Tax Code Test |
2263 | sign : 1.00 |
2264 | - |
2265 | - In order to test the 'Post Journal Entries' wizard in OpenERP, I created an account move |
2266 | + In order to test the post journal entries , I created an account move |
2267 | - |
2268 | !record {model: account.move, id: account_move_0}: |
2269 | - date: !eval time.strftime('%Y-%m-%d') |
2270 | journal_id: account.bank_journal |
2271 | line_id: |
2272 | - - account_id: account.cash |
2273 | - amount_currency: 0.0 |
2274 | + - account_id: cash |
2275 | credit: 2000.0 |
2276 | date: !eval time.strftime('%Y-%m-%d') |
2277 | - debit: 0.0 |
2278 | - journal_id: account.bank_journal |
2279 | - name: Basic Computer |
2280 | - partner_id: base.res_partner_12 |
2281 | - period_id: account.period_6 |
2282 | - ref: '2011010' |
2283 | - tax_amount: 0.0 |
2284 | - name: / |
2285 | - period_id: account.period_6 |
2286 | + journal_id: bank_journal |
2287 | + name: Basic Computer |
2288 | + partner_id: base.res_partner_desertic_hispafuentes |
2289 | + period_id: period_6 |
2290 | + ref: '2011010' |
2291 | + - journal_id: bank_journal |
2292 | + period_id: period_6 |
2293 | + ref: '2011010' |
2294 | + tax_code_id: account_tax_code_0 |
2295 | + account_id: a_recv |
2296 | + date: !eval time.strftime('%Y-%m-%d') |
2297 | + debit: 2000.0 |
2298 | + name: Basic Computer |
2299 | + partner_id: base.res_partner_desertic_hispafuentes |
2300 | + period_id: period_6 |
2301 | ref: '2011010' |
2302 | - state: draft |
2303 | -- |
2304 | - I create another move line |
2305 | -- |
2306 | - !python {model: account.move.line}: | |
2307 | - import time |
2308 | - date = self._get_date(cr, uid, {'lang': u'en_US', 'normal_view': False, 'active_model': 'ir.ui.menu', |
2309 | - 'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'journal_id': 1, 'view_mode': False, |
2310 | - 'visible_id': 1, 'period_id': 6, 'tz': False, 'active_ids': [ref('menu_eaction_account_moves_sale')], |
2311 | - 'search_default_posted': 0, 'active_id': ref('menu_eaction_account_moves_sale')}) |
2312 | - partner = self.onchange_partner_id(cr, uid, [], False, ref('base.res_partner_12'), ref('account.cash'), debit=0, credit=2000, date=date, journal=False) |
2313 | - account = self.onchange_account_id(cr, uid, [], account_id=ref('account.a_recv'), partner_id= ref('base.res_partner_12')) |
2314 | - vals = { |
2315 | - 'journal_id': ref('account.bank_journal'), |
2316 | - 'period_id': ref('account.period_6'), |
2317 | - 'ref': '2011010', |
2318 | - 'tax_code_id': ref('account_tax_code_0'), |
2319 | - 'tax_amount': 0.0, |
2320 | - 'account_id': ref('account.a_recv'), |
2321 | - 'amount_currency': 0.0, |
2322 | - 'credit': 0.0, |
2323 | - 'date': time.strftime('%Y-%m-%d'), |
2324 | - 'debit': 2000.0, |
2325 | - 'name': 'Basic Computer', |
2326 | - 'partner_id': ref('base.res_partner_12'), |
2327 | - 'quantity': 0.0, |
2328 | - 'move_id': ref('account_move_0'), |
2329 | - 'date_maturity': partner['value']['date_maturity'], |
2330 | - 'account_tax_id': account['value']['account_tax_id'] |
2331 | - } |
2332 | - line_id = self.create(cr, uid, vals) |
2333 | - assert line_id, "Account move line has not been created" |
2334 | -- |
2335 | - I check the balance in Journal Items |
2336 | -- |
2337 | - !python {model: account.move.line}: | |
2338 | - ids = self._balance_search(cr, uid, self, 'balance', [('balance', '=', 2000.0)], None, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu', |
2339 | - 'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'view_mode': False, 'visible_id': 1, |
2340 | - 'active_ids': [ref('menu_eaction_account_moves_sale')], 'search_default_posted': 0, 'active_id': ref('menu_eaction_account_moves_sale')}) |
2341 | - bal = self._balance(cr, uid, ids[0][2], 'balance', None,{'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu', |
2342 | - 'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'view_mode': False, |
2343 | - 'visible_id': 1, 'active_ids': [ref('menu_eaction_account_moves_sale')], 'search_default_posted': 0, |
2344 | - 'active_id': ref('menu_eaction_account_moves_sale')}) |
2345 | - assert bal, 'Balance has not been computed correctly' |
2346 | -- |
2347 | - I check that Initially account move state is "Draft" |
2348 | -- |
2349 | - !assert {model: account.move, id: account_move_0, string: initialstatedraft}: |
2350 | - - state == 'draft' |
2351 | -- |
2352 | - I validate this account move by using the 'Post Journal Entries' wizard |
2353 | +- |
2354 | + I create a record for validate the account. |
2355 | - |
2356 | !record {model: validate.account.move, id: validate_account_move_0}: |
2357 | - journal_id: account.bank_journal |
2358 | - period_id: account.period_6 |
2359 | + journal_id: bank_journal |
2360 | + period_id: period_6 |
2361 | - |
2362 | - I click on validate Button |
2363 | + I validate a move. |
2364 | - |
2365 | !python {model: validate.account.move}: | |
2366 | - self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US", "active_model": "ir.ui.menu", |
2367 | - "active_ids": [ref("account.menu_validate_account_moves")], "tz": False, "active_id": ref("account.menu_validate_account_moves"), }) |
2368 | -- |
2369 | - I check that the move state is now "Posted" |
2370 | -- |
2371 | - !assert {model: account.move, id: account_move_0, string: moveincorrect}: |
2372 | + self.validate_move(cr, uid, [ref("validate_account_move_0")], {"active_ids": [ref("menu_validate_account_moves")], "active_id": ref("menu_validate_account_moves"), }) |
2373 | +- |
2374 | + I check that the invoice is "Posted". |
2375 | +- |
2376 | + !assert {model: account.move, id: account_move_0, string: move incorrect}: |
2377 | - state == 'posted' |
2378 | -- |
2379 | - I reconcile the entries partially through "Reconcile Entries" wizard |
2380 | -- |
2381 | - !record {model: account.move.line.reconcile, id: account_move_line_reconcile0}: |
2382 | - trans_nbr: 1 |
2383 | - credit: 0.0 |
2384 | - debit: 2000.0 |
2385 | - writeoff: 2000.0 |
2386 | -- |
2387 | - Then I click on the 'Partial Reconcile' button |
2388 | -- |
2389 | - !python {model: account.move.line.reconcile}: | |
2390 | - move_line_obj = self.pool.get('account.move.line') |
2391 | - ids = move_line_obj.search(cr, uid, [('move_id', '=', ref('account_move_0')),('credit', '=', 2000)]) |
2392 | - partial_reconcile = self.trans_rec_reconcile_partial_reconcile(cr, uid, [ref('account_move_line_reconcile0')], {'lang': u'en_US', |
2393 | - 'active_model': 'account.move.line', 'active_ids': ids, 'tz': False, 'active_id': ids[0]}) |
2394 | - move_line = move_line_obj.browse(cr, uid, ids) |
2395 | - assert move_line[0].reconcile_partial_id, "Partial reconcilation is not done" |
2396 | \ No newline at end of file |
2397 | |
2398 | === modified file 'account/wizard/account_invoice_state.py' |
2399 | --- account/wizard/account_invoice_state.py 2012-08-06 15:44:10 +0000 |
2400 | +++ account/wizard/account_invoice_state.py 2012-08-24 13:00:40 +0000 |
2401 | @@ -47,6 +47,7 @@ |
2402 | |
2403 | account_invoice_confirm() |
2404 | |
2405 | + # TODO:REMOVE -This wizard is not used any time |
2406 | class account_invoice_cancel(osv.osv_memory): |
2407 | """ |
2408 | This wizard will cancel the all the selected invoices. |
2409 | |
2410 | === modified file 'account/wizard/account_invoice_state_view.xml' |
2411 | --- account/wizard/account_invoice_state_view.xml 2012-08-08 10:59:07 +0000 |
2412 | +++ account/wizard/account_invoice_state_view.xml 2012-08-24 13:00:40 +0000 |
2413 | @@ -22,6 +22,7 @@ |
2414 | res_model="account.invoice.confirm" src_model="account.invoice" |
2415 | view_mode="form" target="new" view_type="form" /> |
2416 | |
2417 | + <!-- TODO:REMOVE -This wizard is not used any time --> |
2418 | <record id="account_invoice_cancel_view" model="ir.ui.view"> |
2419 | <field name="name">account.invoice.cancel.form</field> |
2420 | <field name="model">account.invoice.cancel</field> |
2421 | |
2422 | === modified file 'account/wizard/account_move_bank_reconcile.py' |
2423 | --- account/wizard/account_move_bank_reconcile.py 2012-07-25 07:33:57 +0000 |
2424 | +++ account/wizard/account_move_bank_reconcile.py 2012-08-24 13:00:40 +0000 |
2425 | @@ -26,6 +26,7 @@ |
2426 | """ |
2427 | Bank Reconciliation |
2428 | """ |
2429 | + #TODO: REMOVE this file no used |
2430 | _name = "account.move.bank.reconcile" |
2431 | _description = "Move bank reconcile" |
2432 | _columns = { |
2433 | |
2434 | === modified file 'account/wizard/account_move_bank_reconcile_view.xml' |
2435 | --- account/wizard/account_move_bank_reconcile_view.xml 2012-08-08 10:59:07 +0000 |
2436 | +++ account/wizard/account_move_bank_reconcile_view.xml 2012-08-24 13:00:40 +0000 |
2437 | @@ -1,6 +1,7 @@ |
2438 | <?xml version="1.0" encoding="utf-8"?> |
2439 | <openerp> |
2440 | <data> |
2441 | + <!-- TODO: REMOVE this file no used --> |
2442 | <record id="view_account_move_bank_reconcile" model="ir.ui.view"> |
2443 | <field name="name">account.move.bank.reconcile.form</field> |
2444 | <field name="model">account.move.bank.reconcile</field> |
2445 | |
2446 | === modified file 'account/wizard/account_move_line_select.py' |
2447 | --- account/wizard/account_move_line_select.py 2011-01-14 00:11:01 +0000 |
2448 | +++ account/wizard/account_move_line_select.py 2012-08-24 13:00:40 +0000 |
2449 | @@ -28,6 +28,7 @@ |
2450 | _name = "account.move.line.select" |
2451 | _description = "Account move line select" |
2452 | |
2453 | + #TODO:REMOVE -This wizard is not used any time |
2454 | def open_window(self, cr, uid, ids, context=None): |
2455 | mod_obj = self.pool.get('ir.model.data') |
2456 | act_obj = self.pool.get('ir.actions.act_window') |
2457 | |
2458 | === modified file 'account/wizard/account_move_line_select_view.xml' |
2459 | --- account/wizard/account_move_line_select_view.xml 2012-08-08 10:59:07 +0000 |
2460 | +++ account/wizard/account_move_line_select_view.xml 2012-08-24 13:00:40 +0000 |
2461 | @@ -1,7 +1,7 @@ |
2462 | <?xml version="1.0" encoding="utf-8"?> |
2463 | <openerp> |
2464 | <data> |
2465 | - |
2466 | + <!-- TODO:REMOVE -This wizard is not used any time --> |
2467 | <record id="account_move_line_select_button_view" model="ir.ui.view"> |
2468 | <field name="name">Open Move Line Button</field> |
2469 | <field name="model">account.move.line.select</field> |
Test draft2cancel_ invoice. yml is broken. Please check the runbot and fix it.
I think the reason is the hard-coded date 2011-10-07 in the demo and test data.
Thanks,
Raphael