[FIX] invalid action descriptor shape returned by (hr.expense.expense).invoice

* Due to a stray comma, returns view_id as a list of tuples of ids
  (with a single tuple of a single id), should *at most* return a list
  or tuple of ids

* If returning a view_id, pair it with a single view_mode (nobody I
  asked was able to nail down the exact semantics for multiple
  view_mode and a view_ids, so openerp-web accepts either multiple
  view_mode or a view_id but not both)

lp bug: https://launchpad.net/bugs/879314 fixed

bzr revid: xmo@openerp.com-20111021103639-3zx71fu0qrt36zpg
This commit is contained in:
Xavier Morel 2011-10-21 12:36:39 +02:00
parent 5857483a5f
commit f5661001a6
1 changed files with 2 additions and 4 deletions

View File

@ -131,16 +131,14 @@ class hr_expense_expense(osv.osv):
wf_service = netsvc.LocalService("workflow")
mod_obj = self.pool.get('ir.model.data')
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_supplier_form')
res_id = res and res[1] or False,
inv_ids = []
for id in ids:
wf_service.trg_validate(uid, 'hr.expense.expense', id, 'invoice', cr)
inv_ids.append(self.browse(cr, uid, id).invoice_id.id)
return {
'name': _('Supplier Invoices'),
'view_type': 'form',
'view_mode': 'form,tree',
'view_id': [res_id],
'view_mode': 'form',
'view_id': [res[1] if res else False],
'res_model': 'account.invoice',
'context': "{'type':'out_invoice', 'journal_type': 'purchase'}",
'type': 'ir.actions.act_window',