[FIX][account_payment/test/payment_order_process.yml] Fix test/test_hr_timesheet_invoice.yml too

bzr revid: moylop260@vauxoo.com-20130908205724-uylcetl1e4xy908t
This commit is contained in:
Moises Lopez 2013-09-08 13:57:24 -07:00
parent 50492bb349
commit e37f1e0f26
2 changed files with 12 additions and 5 deletions

View File

@ -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
assert invoice_id.amount_tax == 50, "Invoice tax mismatch: %s" % invoice_id.amount_tax

View File

@ -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]