[IMP] accont_voucher: changed case1_usd_usd.yml in order to have it work as expected in the latest version of this module

bzr revid: qdp-launchpad@openerp.com-20111013135109-ulwvoep4lq7opb13
This commit is contained in:
Quentin (OpenERP) 2011-10-13 15:51:09 +02:00
parent da6b886e0d
commit 9bfa7b1196
1 changed files with 13 additions and 31 deletions

View File

@ -179,13 +179,6 @@
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == -10.0), "Writeoff amount is not -10.0"
-
I check that currency rate difference is -34.0
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.currency_rate_difference == -34.0), "Currency rate difference is not -34.0"
-
I confirm the voucher
-
@ -207,9 +200,7 @@
-
I check that my debtor account is correct
-
I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 135 and 56
-
I check that my currency rate difference is correct. 34 in credit with no amount_currency
I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 162 and 63
-
I check that my write-off is correct. 9 debit and 10 amount_currency
-
@ -220,22 +211,20 @@
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
for move_line in move_line_obj.browse(cr, uid, move_lines):
if move_line.amount_currency == -180.00:
assert move_line.credit == 135.00, "Debtor account has wrong entry."
assert move_line.credit == 162.00, "Debtor account has wrong entry."
elif move_line.amount_currency == -70.00:
assert move_line.credit == 56.00, "Debtor account has wrong entry."
elif move_line.credit == 34.00:
assert move_line.amount_currency == 0.00, "Incorrect currency rate difference."
assert move_line.credit == 63.00, "Debtor account has wrong entry."
elif move_line.amount_currency == 10.00:
assert move_line.debit == 9.00, "Writeoff amount is wrong."
-
I check the residual amount of Invoice1, should be 20 in amount_currency and 15 in company currency
I check the residual amount of Invoice1, should be 20 in amount_currency
-
!python {model: account.invoice}: |
invoice_id = self.browse(cr, uid, ref("account_invoice_jan"))
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 == 20.0 and move_line.amount_residual == 15.0) , "Residual amount is not correct for first Invoice"
assert (move_line.amount_residual_currency == 20.0) , "Residual amount is not correct for first Invoice"
-
I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual
-
@ -244,7 +233,7 @@
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 == 30.0 and move_line.amount_residual == 24.0) , "Residual amount is not correct for first Invoice"
assert (move_line.amount_residual_currency == 30.0) , "Residual amount is not correct for first Invoice"
-
I create the second voucher of payment
<create with values 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$>
@ -287,13 +276,6 @@
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == -5.0), "Writeoff amount is not -5.0"
-
I check that currency rate difference is -8.50
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.currency_rate_difference == -8.50), "Currency rate difference is not -8.50"
-
I confirm the voucher
-
@ -315,7 +297,7 @@
-
I check that my debtor account is correct
-
I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24.
I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 19 and 28.5
-
I check that my currency rate difference is correct. 8.5 in credit with no amount_currency
-
@ -328,13 +310,13 @@
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
for move_line in move_line_obj.browse(cr, uid, move_lines):
if move_line.amount_currency == -20.00:
assert move_line.credit == 15.00, "Debtor account has wrong entry."
assert move_line.credit == 19.00, "Debtor account has wrong entry."
elif move_line.amount_currency == -30.00:
assert move_line.credit == 24.00, "Debtor account has wrong entry."
elif move_line.credit == 8.50:
assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
assert move_line.credit == 28.50, "Debtor account has wrong entry."
elif move_line.amount_currency == 5.00:
assert move_line.debit == 4.75, "Writeoff amount is wrong."
-
I should check that the total reconcilaition created entries as expected: TODO
-
I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid
-
@ -344,7 +326,7 @@
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 == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice"
-
-
I check the residual amuont of Invoice2, should be 0 in residual currency and 0 in amount_residual and paid
-
!python {model: account.invoice}: |
@ -352,4 +334,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 == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"
assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"