[MERGE] [FIX] document_page: allow other users than administrator to create menu to a static page

Due to a global rule on ir.values (which is created when creating a ir.ui.menu), we need to execute the action as super user.

bzr revid: mat@openerp.com-20140508093129-tzkqpizpwr7vv0zu
This commit is contained in:
Martin Trigaux 2014-05-08 11:31:29 +02:00
commit 133c5033a0
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#
##############################################################################
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
class document_page_create_menu(osv.osv_memory):
@ -70,7 +71,8 @@ class document_page_create_menu(osv.osv_memory):
value['res_id'] = page.id
action_id = obj_action.create(cr, uid, value)
menu_id = obj_menu.create(cr, uid, {
# only the super user is allowed to create menu due to security rules on ir.values
menu_id = obj_menu.create(cr, SUPERUSER_ID, {
'name': data.menu_name,
'parent_id':data.menu_parent_id.id,
'icon': 'STOCK_DIALOG_QUESTION',