From 8b52547bea4a436b4dbd7e4527a32a41ce74ecf0 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Fri, 28 May 2010 15:57:37 +0530 Subject: [PATCH] [IMP] account: changes in YAML test cases for invoices bzr revid: psi@tinyerp.co.in-20100528102737-63k6hi7tjt3jjcra --- .../account/test/account_customer_invoice.yml | 6 ++-- .../account/test/account_supplier_invoice.yml | 28 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/account/test/account_customer_invoice.yml b/addons/account/test/account_customer_invoice.yml index 6e9ede4ca5b..1700f08b470 100644 --- a/addons/account/test/account_customer_invoice.yml +++ b/addons/account/test/account_customer_invoice.yml @@ -138,6 +138,6 @@ # Performing an osv_memory action invoice_refund on module account.invoice.refund #- # !python {model: account.invoice.refund}: | -# 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_0")], -# "type": "out_invoice", "active_id": ref("account.account_invoice_0"), }) +# 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_0")], "type": "out_invoice", "active_id": ref("account.account_invoice_0"), }) +# return self.compute_refund(cr, uid, [ref("account_invoice_refund_0")], "refund" {"lang": 'en_US',"tz": False, "active_model": "account.invoice", "active_ids": [ref("account.account_invoice_0")], "type": "out_invoice", "active_id": ref("account.account_invoice_0"), }) + diff --git a/addons/account/test/account_supplier_invoice.yml b/addons/account/test/account_supplier_invoice.yml index 62c77e3128d..a577fa8330b 100644 --- a/addons/account/test/account_supplier_invoice.yml +++ b/addons/account/test/account_supplier_invoice.yml @@ -3,7 +3,7 @@ - Creating a account.invoice record - - !record {model: account.invoice, id: account_invoice_0}: + !record {model: account.invoice, id: account_invoice_1}: account_id: account.a_pay address_contact_id: base.res_partner_address_3000 address_invoice_id: base.res_partner_address_3000 @@ -22,20 +22,20 @@ reference_type: none type: in_invoice - - I check that Initially customer invoice is in the draft state + I check that Initially supplier invoice is in the draft state - - !assert {model: account.invoice, id: account_invoice_0}: + !assert {model: account.invoice, id: account_invoice_1}: - state == 'draft' - I change the state of invoice to open by clicking Validate button - Performing a workflow action invoice_open on module account.invoice - - !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_0} + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_1} - I check that the invoice state is now open - - !assert {model: account.invoice, id: account_invoice_0}: + !assert {model: account.invoice, id: account_invoice_1}: - state == 'open' - I make a partial payment of 2000 by clicking on Pay Invoice button @@ -55,12 +55,12 @@ !python {model: account.invoice.pay}: | self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_firstpaymenttoaxelorforbasicpc0")], {"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id": - 25, "active_ids": [ref("account_invoice_0")], "type": "in_invoice", "active_id": - ref("account_invoice_0"), }) + 25, "active_ids": [ref("account_invoice_1")], "type": "in_invoice", "active_id": + ref("account_invoice_1"), }) - I check that the invoice state is still open - - !assert {model: account.invoice, id: account_invoice_0}: + !assert {model: account.invoice, id: account_invoice_1}: - state == 'open' - I make final partial payment of 1000 by clicking on Pay Invoice button @@ -81,19 +81,19 @@ !python {model: account.invoice.pay}: | self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_finalpaymenttoaxelorforbasicpc0")], {"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id": - 25, "active_ids": [ref("account_invoice_0")], "type": "in_invoice", "active_id": - ref("account_invoice_0"), }) + 25, "active_ids": [ref("account_invoice_1")], "type": "in_invoice", "active_id": + ref("account_invoice_1"), }) - I check that the invoice state is now Done - - !assert {model: account.invoice, id: account_invoice_0}: + !assert {model: account.invoice, id: account_invoice_1}: - state == 'paid' - I check that an payment entry gets created in the account.move.line - !python {model: account.invoice}: | - acc_id=self.browse(cr, uid, ref("account_invoice_0")) + acc_id=self.browse(cr, uid, ref("account_invoice_1")) assert(acc_id.move_id) #- # I refund the invoice @@ -110,8 +110,8 @@ #- # !python {model: account.invoice.refund}: | # self.invoice_refund(cr, uid, [ref("account_invoice_refund_0")], {"lang": 'en_US', -# "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_0")], -# "type": "in_invoice", "active_id": ref("account_invoice_0"), }) +# "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_1")], +# "type": "in_invoice", "active_id": ref("account_invoice_1"), })