_columns = {
'group_id': fields.many2one('res.groups', required=True, ondelete='cascade',
string='Group',
- help='The group extended by this portal'),
+ help='The group corresponding to this portal'),
'url': fields.char('URL', size=64,
help="The url where portal users can connect to the server"),
+ 'home_action_id': fields.many2one('ir.actions.actions',
+ string='Home Action',
+ help="if set, replaces the standard home action (first screen after loggin) for the portal's users"),
'menu_action_id': fields.many2one('ir.actions.act_window', readonly=True,
# ISSUE: 'ondelete' constraints do not seem effective on this field...
string='Menu Action',
act_window_obj.write(cr, uid, action_ids, action_values, context)
return True
-
- 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 = {
- 'name': _('%s Menu') % p.name,
- '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)
- 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):
- """ assign portal menu to users of portals (ids) """
+ """ assign portal_menu_settings to users of portals (ids) """
user_obj = self.pool.get('res.users')
for p in self.browse(cr, uid, ids, context):
# user menu action = portal menu action if set in portal