diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index d8f3cde88b4..8cdc79df521 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -75,7 +75,11 @@ class report_custom(osv.osv): 'type': fields.char('Report Type', size=32, required=True), 'model':fields.char('Model', size=64, required=True), 'report_id': fields.integer('Report Ref.', required=True), - 'usage': fields.char('Action Usage', size=32) + 'usage': fields.char('Action Usage', size=32), + 'multi': fields.boolean('On multiple doc.', help="If set to true, the action will not be displayed on the right toolbar of a form views.") + } + _defaults = { + 'multi': lambda *a: False, } report_custom() @@ -96,9 +100,11 @@ class report_xml(osv.osv): 'auto': fields.boolean('Automatic XSL:RML', required=True), 'usage': fields.char('Action Usage', size=32), 'header': fields.boolean('Add RML header', help="Add or not the coporate RML header"), + 'multi': fields.boolean('On multiple doc.', help="If set to true, the action will not be displayed on the right toolbar of a form views.") } _defaults = { 'type': lambda *a: 'ir.actions.report.xml', + 'multi': lambda *a: False, 'auto': lambda *a: True, 'header': lambda *a: True, 'report_sxw_content': lambda *a: False, @@ -157,6 +163,10 @@ class act_window_view(osv.osv): 'view_id': fields.many2one('ir.ui.view', 'View'), 'view_mode': fields.selection((('tree', 'Tree'),('form', 'Form'),('graph', 'Graph')), string='Type of view', required=True), 'act_window_id': fields.many2one('ir.actions.act_window', 'Action'), + 'multi': fields.boolean('On multiple doc.', help="If set to true, the action will not be displayed on the right toolbar of a form views.") + } + _defaults = { + 'multi': lambda *a: False, } _order = 'sequence' act_window_view() diff --git a/bin/osv/orm.py b/bin/osv/orm.py index d06c069e3af..31b56f647f4 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1342,6 +1342,7 @@ class orm(object): resprint = map(clean, resprint) resaction = map(clean, resaction) resaction = filter(lambda x: not x.get('multi',False), resaction) + resprint = filter(lambda x: not x.get('multi',False), resprint) resrelate = map(lambda x:x[2], resrelate) for x in resprint+resaction+resrelate: x['string'] = x['name'] diff --git a/bin/tools/convert.py b/bin/tools/convert.py index 61f3de130d8..bb7e8ef66a6 100644 --- a/bin/tools/convert.py +++ b/bin/tools/convert.py @@ -148,6 +148,7 @@ class xml_import(object): res['report_sxw_content'] = sxw_content if rec.hasAttribute('header'): res['header'] = eval(rec.getAttribute('header')) + res['multi'] = rec.hasAttribute('multi') and eval(rec.getAttribute('multi')) xml_id = rec.getAttribute('id').encode('utf8') id = self.pool.get('ir.model.data')._update(cr, self.uid, "ir.actions.report.xml", self.module, res, xml_id, mode=self.mode) self.idref[xml_id] = id