[FIX] account_analytic_analysis: timesheet_ca_invoiced

The function "_timesheet_ca_invoiced_calc" must not take lines from invoice in state "draft" or "cancel"
to compute timesheet_ca_invoiced. Inspired from function "_ca_invoiced_calc".

opw646602
This commit is contained in:
Goffin Simon 2015-08-06 08:30:41 +02:00
parent 0b74fbed74
commit 6e2026dcda
1 changed files with 1 additions and 1 deletions

View File

@ -374,7 +374,7 @@ class account_analytic_account(osv.osv):
inv_ids = []
for account in self.browse(cr, uid, ids, context=context):
res[account.id] = 0.0
line_ids = lines_obj.search(cr, uid, [('account_id','=', account.id), ('invoice_id','!=',False), ('to_invoice','!=', False), ('journal_id.type', '=', 'general'), ('invoice_id.type', 'in', ['out_invoice', 'out_refund'])], context=context)
line_ids = lines_obj.search(cr, uid, [('account_id','=', account.id), ('invoice_id','!=',False), ('invoice_id.state', 'not in', ['draft', 'cancel']), ('to_invoice','!=', False), ('journal_id.type', '=', 'general'), ('invoice_id.type', 'in', ['out_invoice', 'out_refund'])], context=context)
for line in lines_obj.browse(cr, uid, line_ids, context=context):
if line.invoice_id not in inv_ids:
inv_ids.append(line.invoice_id)