[IMP] attach the 'Our company' menu items to the portal's root menu
[odoo/odoo.git] / addons / portal / portal.py
index 1c7f84c..399377e 100644 (file)
@@ -36,9 +36,12 @@ class portal(osv.osv):
     _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',
@@ -94,27 +97,9 @@ class portal(osv.osv):
                 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')
-        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)
-        
-        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
@@ -226,3 +211,5 @@ portal_widget()
 
 
 
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: