[IMP] hr_timesheet_invoice: cleanup/simplify previous commit

bzr revid: odo@openerp.com-20131003104355-2ttyu8wnactkawmn
This commit is contained in:
Olivier Dony 2013-10-03 12:43:55 +02:00
parent c7d9baf099
commit 306b2295c6
2 changed files with 11 additions and 17 deletions

View File

@ -79,18 +79,15 @@
I click on "Create Invoice" button of "Invoice analytic Line" wizard to create invoice.
-
!python {model: hr.timesheet.invoice.create}: |
created=self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_0")], {
action_result = 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', False)
if invoice_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") ) })
else:
pass#Assert missed invoice in next section
invoice_domain = action_result['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.
-

View File

@ -78,17 +78,14 @@
I click on "Create Invoice" button of "Invoice analytic Line" wizard to create invoice.
-
!python {model: hr.timesheet.invoice.create}: |
created=self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_0")], {
action_result = 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', False)
if invoice_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"))\
+ '_aaldyfhrm1_id_'+str( ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule1") ) })
else:
pass#Assert missed invoice in next section
invoice_domain = action_result['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"))\
+ '_aaldyfhrm1_id_'+str( ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule1") ) })
-
I check that Invoice is created for this timesheet.
-