From 0f63b4a1fb8a41971d1fd6a9810a75a7af5de759 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 22 Aug 2012 15:34:06 +0200 Subject: [PATCH] [IMP] need action bzr revid: fp@tinyerp.com-20120822133406-9ayg228mxfeg16dg --- openerp/addons/base/ir/ir_actions.py | 4 +++- openerp/addons/base/ir/ir_ui_menu.py | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 28a309f427a..b70a9d89c06 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -43,7 +43,6 @@ class actions(osv.osv): _table = 'ir_actions' _order = 'name' _columns = { - 'name': fields.char('Action Name', required=True, size=64), 'type': fields.char('Action Type', required=True, size=32,readonly=True), 'usage': fields.char('Action Usage', size=32), } @@ -872,10 +871,13 @@ class act_client(osv.osv): self.write(cr, uid, id, {'params_store': field_value}, context=context) _columns = { + 'name': fields.char('Action Name', required=True, size=64, translate=True), 'tag': fields.char('Client action tag', size=64, required=True, help="An arbitrary string, interpreted by the client" " according to its own needs and wishes. There " "is no central tag repository across clients."), + 'res_model': fields.char('Destination Model', size=64, + help="Optional model, mostly used for needactions."), 'params': fields.function(_get_params, fnct_inv=_set_params, type='binary', string="Supplementary arguments", diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py index f5e4ee2ba05..bc743d34fc0 100644 --- a/openerp/addons/base/ir/ir_ui_menu.py +++ b/openerp/addons/base/ir/ir_ui_menu.py @@ -264,12 +264,10 @@ class ir_ui_menu(osv.osv): res[menu.id]['needaction_enabled'] = False res[menu.id]['needaction_counter'] = False res[menu.id] = {} - if menu.action and menu.action.type == 'ir.actions.act_window' and menu.action.res_model: + if menu.action and menu.action.type in ('ir.actions.act_window','ir.actions.client') and menu.action.res_model: obj = self.pool.get(menu.action.res_model) if obj._needaction: res[menu.id]['needaction_enabled'] = obj._needaction - # check domain and context: should we evaluate the domain ? - # and add context of the action ? res[menu.id]['needaction_counter'] = obj._needaction_count(cr, uid, menu.action.domain, context=context) return res