[ADD] ir.actions.act_window: added support for multi=True parameter to hide an act_window in single item view (already supported on other actions)
bzr revid: odo@openerp.com-20101015140729-cy520ac0m63e5tca
This commit is contained in:
parent
acf5105783
commit
bf6165b3fe
|
@ -255,8 +255,10 @@ class act_window(osv.osv):
|
|||
'help': fields.text('Action description',
|
||||
help='Optional help text for the users with a description of the target view, such as its usage and purpose.'),
|
||||
'display_menu_tip':fields.function(_get_help_status, type='boolean', method=True, string='Display Menu Tips',
|
||||
help='It gives the status if the tip has to be displayed or not when a user executes an action')
|
||||
help='It gives the status if the tip has to be displayed or not when a user executes an action'),
|
||||
'multi': fields.boolean('Action on Multiple Doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'type': lambda *a: 'ir.actions.act_window',
|
||||
'view_type': lambda *a: 'form',
|
||||
|
@ -265,7 +267,8 @@ class act_window(osv.osv):
|
|||
'limit': lambda *a: 80,
|
||||
'target': lambda *a: 'current',
|
||||
'auto_refresh': lambda *a: 0,
|
||||
'auto_search':lambda *a: True
|
||||
'auto_search':lambda *a: True,
|
||||
'multi': False,
|
||||
}
|
||||
|
||||
act_window()
|
||||
|
|
|
@ -488,6 +488,8 @@ form: module.record_id""" % (xml_id,)
|
|||
|
||||
if rec.get('target'):
|
||||
res['target'] = rec.get('target','')
|
||||
if rec.get('multi'):
|
||||
res['multi'] = rec.get('multi', False)
|
||||
id = self.pool.get('ir.model.data')._update(cr, self.uid, 'ir.actions.act_window', self.module, res, xml_id, noupdate=self.isnoupdate(data_node), mode=self.mode)
|
||||
self.idref[xml_id] = int(id)
|
||||
|
||||
|
|
|
@ -607,6 +607,7 @@ class YamlInterpreter(object):
|
|||
'usage': node.usage,
|
||||
'limit': node.limit,
|
||||
'auto_refresh': node.auto_refresh,
|
||||
'multi': getattr(node, 'multi', False),
|
||||
}
|
||||
|
||||
self._set_group_values(node, values)
|
||||
|
|
Loading…
Reference in New Issue