[IMP] need action

bzr revid: fp@tinyerp.com-20120822133406-9ayg228mxfeg16dg
This commit is contained in:
Fabien Pinckaers 2012-08-22 15:34:06 +02:00
parent 9871b2dd37
commit 0f63b4a1fb
2 changed files with 4 additions and 4 deletions

View File

@ -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",

View File

@ -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