From e37f1e0f2668dd7af6ccd0780ad59ff46c2375a7 Mon Sep 17 00:00:00 2001 From: Moises Lopez Date: Sun, 8 Sep 2013 13:57:24 -0700 Subject: [PATCH] [FIX][account_payment/test/payment_order_process.yml] Fix test/test_hr_timesheet_invoice.yml too bzr revid: moylop260@vauxoo.com-20130908205724-uylcetl1e4xy908t --- .../test/test_hr_timesheet_invoice.yml | 13 ++++++++++--- .../test/test_hr_timesheet_invoice_no_prod_tax.yml | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml index 05326bb19c1..429bf1fb818 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml @@ -79,7 +79,12 @@ I click on "Create Invoice" button of "Invoice analytic Line" wizard to create invoice. - !python {model: hr.timesheet.invoice.create}: | - self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_0")], {"active_ids": [ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule0")]}) + created=self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_0")], {"active_ids": [ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule0")]}) + invoice_pool = self.pool.get('account.invoice') + invoice_domain = created.get('domain') + invoice_ids = invoice_pool.search(cr, uid, invoice_domain) + invoice_pool.write(cr, uid, invoice_ids, {'origin': 'test-hrtsic0_id_'+str( ref("hr_timesheet_invoice_create_0")) + '_aaldyfhrm0_id_'+str( ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule0") ) }) + - I check that Invoice is created for this timesheet. - @@ -90,7 +95,9 @@ partner = aline.account_id.partner_id.id invoice_obj = self.pool.get('account.invoice') - invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', partner)]) + invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', partner), + ('origin', '=', 'test-hrtsic0_id_'+str( ref("hr_timesheet_invoice_create_0")) + '_aaldyfhrm0_id_'+str( ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule0") )) + ]) invoice_id = invoice_obj.browse(cr, uid, invoice_ids)[0] for invoice in invoice_id.invoice_line: @@ -102,4 +109,4 @@ assert aline.invoice_id, "Invoice created, but analytic line wasn't updated." assert aline.invoice_id == invoice_id, "Invoice doesn't match the one at analytic line" assert invoice_id.amount_untaxed == 187.5, "Invoice amount mismatch: %s" % invoice_id.amount_untaxed - assert invoice_id.amount_tax == 50, "Invoice tax mismatch: %s" % invoice_id.amount_tax \ No newline at end of file + assert invoice_id.amount_tax == 50, "Invoice tax mismatch: %s" % invoice_id.amount_tax diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml index 48945b172c7..5c2c73a2b7e 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml @@ -82,7 +82,7 @@ invoice_pool = self.pool.get('account.invoice') invoice_domain = created.get('domain') invoice_ids = invoice_pool.search(cr, uid, invoice_domain) - invoice_pool.write(cr, uid, invoice_ids, {'origin': 'test_hr_timesheet_invoice_create_0_id_'+str( ref("hr_timesheet_invoice_create_0")) }) + invoice_pool.write(cr, uid, invoice_ids, {'origin': 'test-hrtsic0_id_'+str( ref("hr_timesheet_invoice_create_0")) + '_aaldyfhrm1_id_'+str( ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule1") ) }) - I check that Invoice is created for this timesheet. @@ -95,7 +95,7 @@ invoice_obj = self.pool.get('account.invoice') invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', partner), - ('origin','=','test_hr_timesheet_invoice_create_0_id_'+str( ref("hr_timesheet_invoice_create_0")) ) + ('origin', '=', 'test-hrtsic0_id_'+str( ref("hr_timesheet_invoice_create_0")) + '_aaldyfhrm1_id_'+str( ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule1") )) ]) invoice_id = invoice_obj.browse(cr, uid, invoice_ids)[0]