add group to created menuitem, and bug fix in call to write()

bzr revid: rco@openerp.com-20110404090535-o0gzcakbo7f7z4t7
This commit is contained in:
Raphael Collet
2011-04-04 11:05:35 +02:00
parent 3a65fdf1f1
commit cb2137c5da
+2 -1
View File
@@ -116,10 +116,11 @@ class portal(osv.osv):
menu_values = {
'name': p.name + ' Menu',
'parent_id': menu_root,
'groups_id': [(6, 0, [p.group_id.id])],
}
menu_id = menu_obj.create(cr, uid, menu_values, context)
# set the parent_menu_id to item_id
self.write(cr, uid, p.id, {'parent_menu_id': menu_id}, context)
self.write(cr, uid, [p.id], {'parent_menu_id': menu_id}, context)
return True