diff --git a/bin/addons/base/i18n/fr.po b/bin/addons/base/i18n/fr.po index cec2ad67d08..6d90ad75874 100644 --- a/bin/addons/base/i18n/fr.po +++ b/bin/addons/base/i18n/fr.po @@ -2389,6 +2389,7 @@ msgstr "" #. module: base #: model:ir.actions.act_window,name:base.action_partner_customer_form +#: model:ir.ui.menu,name:base.menu_partner_form #: view:res.partner:0 msgid "Customers" msgstr "Clients" @@ -6874,10 +6875,6 @@ msgid "Landscape" msgstr "Paysage" #. module: base -#: model:ir.actions.act_window,name:base.action_partner_form -#: model:ir.ui.menu,name:base.menu_base_config_partner -#: model:ir.ui.menu,name:base.menu_base_partner -#: model:ir.ui.menu,name:base.menu_partner_form #: view:res.partner:0 #: view:res.partner.category:0 #: field:res.partner.category,partner_ids:0 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/addons/base/ir/ir_ui_menu.py b/bin/addons/base/ir/ir_ui_menu.py index 6b4d98962b4..ec923074573 100644 --- a/bin/addons/base/ir/ir_ui_menu.py +++ b/bin/addons/base/ir/ir_ui_menu.py @@ -69,9 +69,14 @@ class ir_ui_menu(osv.osv): def create_shortcut(self, cr, uid, values, context={}): dataobj = self.pool.get('ir.model.data') - menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut', context) - shortcut_menu_id = int(dataobj.read(cr, uid, menu_id, ['res_id'], context)['res_id']) - action_id = self.pool.get('ir.actions.act_window').create(cr, uid, values, context) + new_context = context.copy() + for key in context: + if key.startswith('default_'): + del new_context[key] + + menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut', new_context) + shortcut_menu_id = int(dataobj.read(cr, uid, menu_id, ['res_id'], new_context)['res_id']) + action_id = self.pool.get('ir.actions.act_window').create(cr, uid, values, new_context) menu_data = {'name':values['name'], 'sequence':10, 'action':'ir.actions.act_window,'+str(action_id), @@ -79,7 +84,7 @@ class ir_ui_menu(osv.osv): 'icon':'STOCK_JUSTIFY_FILL'} menu_id = self.pool.get('ir.ui.menu').create(cr, uid, menu_data) sc_data= {'name':values['name'], 'sequence': 1,'res_id': menu_id } - sc_menu_id = self.pool.get('ir.ui.view_sc').create(cr, uid, sc_data, context) + sc_menu_id = self.pool.get('ir.ui.view_sc').create(cr, uid, sc_data, new_context) user_groups = set(self.pool.get('res.users').read(cr, 1, uid, ['groups_id'])['groups_id']) key = (cr.dbname, shortcut_menu_id, tuple(user_groups)) diff --git a/bin/addons/base/maintenance/maintenance_view.xml b/bin/addons/base/maintenance/maintenance_view.xml index 8422d012b28..836344a52df 100644 --- a/bin/addons/base/maintenance/maintenance_view.xml +++ b/bin/addons/base/maintenance/maintenance_view.xml @@ -107,7 +107,7 @@