[ADD] account_voucher: added case3_eur_eur.yml

bzr revid: qdp-launchpad@openerp.com-20111017074316-mh11ronz30vxsuz4
This commit is contained in:
Quentin (OpenERP) 2011-10-17 09:43:16 +02:00
parent 0c0881e17f
commit 1abc42257d
2 changed files with 7 additions and 41 deletions

View File

@ -63,7 +63,7 @@ Account Voucher module includes all the basic requirements of Voucher Entries fo
"test/case1_usd_usd.yml",
"test/case2_usd_eur_debtor_in_eur.yml",
"test/case2_usd_eur_debtor_in_usd.yml",
#"test/case3_eur_eur.yml",
"test/case3_eur_eur.yml",
#"test/case4_cad_chf.yml",
],
'certificate': '0037580727101',

View File

@ -9,26 +9,12 @@
name: !eval "'%s-01-01' %(datetime.now().year)"
rate: 1.000000
-
I create currency EUR in OpenERP for February of 1.000000 Rate
I modify the debtor account in order to make sure there is no currency_id linked
-
!record {model: res.currency.rate, id: feb_eur}:
currency_id: base.EUR
name: !eval "'%s-02-01' %(datetime.now().year)"
rate: 1.000000
-
I create currency EUR in OpenERP for March of 1.000000 Rate
-
!record {model: res.currency.rate, id: mar_eur}:
currency_id: base.EUR
name: !eval "'%s-03-01' %(datetime.now().year)"
rate: 1.000000
-
I create currency EUR in OpenERP for April of 1.000000 Rate
-
!record {model: res.currency.rate, id: apr_eur}:
currency_id: base.EUR
name: !eval "'%s-04-01' %(datetime.now().year)"
rate: 1.000000
!python {model: account.account}: |
from datetime import datetime
ids = self.search(cr, uid, [('name', 'ilike', 'debtor')])
self.write(cr, uid, ids, {'currency_id': False})
-
I create a bank journal with EUR as currency
-
@ -43,12 +29,6 @@
currency: base.EUR
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I set up some accounts for currency rate expense/income in my company
-
!record {model: res.company, id: base.main_company}:
property_expense_currency_exchange: account.o_expense
property_income_currency_exchange: account.o_income
-
I create a new partner Peter Lawson.
-
@ -172,13 +152,6 @@
voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0.00"
-
I check that currency rate difference is 0.00
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.currency_rate_difference == 0.00), "Currency rate difference is not 0.00"
-
I confirm the voucher
-
@ -271,13 +244,6 @@
voucher = self.search(cr, uid, [('name', '=', 'Second payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0"
-
I check that currency rate difference is 0.00
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.currency_rate_difference == 0.00), "Currency rate difference is not 0"
-
I confirm the voucher
-
@ -328,4 +294,4 @@
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
move_line = move_line_obj.browse(cr, uid, move_lines[0])
assert (move_line.amount_residual_currency == -10.0 and move_line.amount_residual == -10.0) , "Residual amount is not correct for second Invoice"
assert (move_line.amount_residual_currency == -10.0 and move_line.amount_residual == -10.0) , "Residual amount is not correct for second Invoice"