From cc84c31d1bedf3b4a18827fd4b3f2fd0799b86a3 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Thu, 23 Sep 2010 18:01:07 +0530 Subject: [PATCH] [FIX] account : YML test of currency Corrected bzr revid: ach@tinyerp.com-20100923123107-cln1mtwionpkj56j --- .../account/test/account_change_currency.yml | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/addons/account/test/account_change_currency.yml b/addons/account/test/account_change_currency.yml index d68b5fb90b5..4fe89534ce5 100644 --- a/addons/account/test/account_change_currency.yml +++ b/addons/account/test/account_change_currency.yml @@ -23,15 +23,6 @@ - !assert {model: account.invoice, id: account_invoice_currency, string: Customer Invoice is in Draft state}: - state == 'draft' -- - I change the state of invoice to proforma2 by clicking PRO-FORMA button -- - !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_currency} -- - I check that now customer invoice is in the "proforma2" state -- - !assert {model: account.invoice, id: account_invoice_currency}: - - state == 'proforma2' - Now I select USD as new currency - @@ -41,17 +32,23 @@ I clicked on Change Currency button to change the currency - !python {model: account.change.currency}: | - try: - self.view_init(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', - "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), - }) - self.change_currency(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', - "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), - }) - except: - print "Error: You can change currency only for Draft Invoice !" + self.view_init(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', + "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": + [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), + }) + self.change_currency(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', + "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": + [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), + }) +- + I change the state of invoice to proforma2 by clicking PRO-FORMA button +- + !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_currency} +- + I check that now customer invoice is in the "proforma2" state +- + !assert {model: account.invoice, id: account_invoice_currency}: + - state == 'proforma2' - I can't change the currency of invoice when it is not in draft state so i change the state to cancel -