[FIX]portal: create record of ir_model_data and ir_value for portal
lp bug: https://launchpad.net/bugs/903474 fixed bzr revid: kjo@tinyerp.com-20111215112912-o1y70syaidufq1ru
This commit is contained in:
parent
3ad3baefba
commit
70a2e53926
|
@ -98,8 +98,9 @@ class portal(osv.osv):
|
|||
def do_create_menu(self, cr, uid, ids, context=None):
|
||||
""" create a parent menu for the given portals """
|
||||
menu_obj = self.pool.get('ir.ui.menu')
|
||||
ir_data = self.pool.get('ir.model.data')
|
||||
ir_value = self.pool.get('ir.values')
|
||||
menu_root = self._res_xml_id(cr, uid, 'portal', 'portal_menu')
|
||||
|
||||
for p in self.browse(cr, uid, ids, context):
|
||||
# create a menuitem under 'portal.portal_menu'
|
||||
menu_values = {
|
||||
|
@ -110,7 +111,12 @@ class portal(osv.osv):
|
|||
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)
|
||||
|
||||
menu_values.update({'model': 'ir.ui.menu',
|
||||
'module': 'portal',
|
||||
'res_id': menu_id,
|
||||
'noupdate': 'True'})
|
||||
data_id = ir_data.create(cr, uid, menu_values, context)
|
||||
value_id = ir_value.create(cr, uid, menu_values, context)
|
||||
return True
|
||||
|
||||
def _assign_menu(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -21,7 +21,7 @@ the portal's users.
|
|||
</record>
|
||||
<menuitem name="Portals" id="portal_list_menu"
|
||||
parent="portal_menu" sequence="1" action="portal_list_action"/>
|
||||
|
||||
|
||||
<!-- portal tree view -->
|
||||
<record id="portal_list_view" model="ir.ui.view">
|
||||
<field name="name">Portal List</field>
|
||||
|
|
Loading…
Reference in New Issue