[FIX][hr_timesheet_invoice] Fix global->particular invoice search to test_hr_timesheet_invoice_no_prod_tax

bzr revid: moylop260@vauxoo.com-20130907161501-9uip7h4simwv8ccz
This commit is contained in:
Moises Lopez 2013-09-07 09:15:01 -07:00
parent 54a8cbb7cd
commit 50492bb349
1 changed files with 11 additions and 3 deletions

View File

@ -78,7 +78,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_developyamlforhrmodule1")]})
created=self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_0")], {"active_ids": [ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule1")]})
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")) })
-
I check that Invoice is created for this timesheet.
-
@ -89,7 +94,10 @@
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_hr_timesheet_invoice_create_0_id_'+str( ref("hr_timesheet_invoice_create_0")) )
])
invoice_id = invoice_obj.browse(cr, uid, invoice_ids)[0]
for invoice in invoice_id.invoice_line:
@ -101,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 == 40, "Invoice tax mismatch: %s" % invoice_id.amount_tax
assert invoice_id.amount_tax == 40, "Invoice tax mismatch: %s" % invoice_id.amount_tax