From 82228fdbf13f9fbf9d07c8cd65146dd21702159a Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 12 May 2009 12:20:06 +0530 Subject: [PATCH] [FIX] Bug 373182 : Invoice analytic lines wizard action corrected(ref:PAP) bzr revid: jvo@tinyerp.com-20090512065006-qq1t2h89v126zt3x --- .../wizard/hr_timesheet_invoice_create.py | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index e950aacd78a..45205b03d2d 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -158,18 +158,29 @@ class invoice_create(wizard.interface): pool.get('account.invoice.line').create(cr, uid, curr_line) strids = ','.join(map(str, data['ids'])) cr.execute("update account_analytic_line set invoice_id=%%s WHERE account_id = %%s and id IN (%s)" % strids, (last_invoice,account.id,)) + pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context) - - return { - 'domain': "[('id','in', ["+','.join(map(str,invoices))+"])]", - 'name': _('Invoices'), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'account.invoice', - 'view_id': False, - 'context': "{'type':'out_invoice'}", - 'type': 'ir.actions.act_window' - } + + mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data') + act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window') + + mod_id = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')])[0] + res_id = mod_obj.read(cr, uid, mod_id, ['res_id'])['res_id'] + act_win = act_obj.read(cr, uid, res_id, []) + act_win['domain'] = [('id','in',[(','.join(map(str,invoices)))]),('type','=','out_invoice')] + act_win['name'] = _('Invoices') + return act_win + +# return { +# 'domain': "[('id','in', ["+','.join(map(str,invoices))+"])]", +# 'name': _('Invoices'), +# 'view_type': 'form', +# 'view_mode': 'tree,form', +# 'res_model': 'account.invoice', +# 'view_id': False, +# 'context': "{'type':'out_invoice'}", +# 'type': 'ir.actions.act_window' +# } _create_form = """