summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2010-10-15 16:07:29 +0200
committerOlivier Dony <odo@openerp.com>2010-10-15 16:07:29 +0200
commitbf6165b3fe5396d4340c8d6ed90e1ac7780cbf45 (patch)
treedd5b58aeefe9bde90a166ffd86bcdbe5ce125727
parentacf51057835ee0e12a6e73730217d239bd98a477 (diff)
[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
-rw-r--r--bin/addons/base/ir/ir_actions.py7
-rw-r--r--bin/tools/convert.py2
-rw-r--r--bin/tools/yaml_import.py1
3 files changed, 8 insertions, 2 deletions
diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py
index 1774b64fefa..5e37c1fa614 100644
--- a/bin/addons/base/ir/ir_actions.py
+++ b/bin/addons/base/ir/ir_actions.py
@@ -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()
diff --git a/bin/tools/convert.py b/bin/tools/convert.py
index 6059d4a54ec..a69885be4db 100644
--- a/bin/tools/convert.py
+++ b/bin/tools/convert.py
@@ -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)
diff --git a/bin/tools/yaml_import.py b/bin/tools/yaml_import.py
index 7b3c5edc6e1..8aaf34f7bf6 100644
--- a/bin/tools/yaml_import.py
+++ b/bin/tools/yaml_import.py
@@ -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)