From 3d18e777312e8a908e05c8ff786585000fc17102 Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers <fp@tinyerp.com>
Date: Mon, 18 Oct 2010 09:37:15 +0200
Subject: [PATCH] [IMP] default group for new users

bzr revid: fp@tinyerp.com-20101018073715-bqryv7c864cab5se
---
 bin/addons/base/res/res_user.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py
index 5507933537a7..b4604de6da40 100644
--- a/bin/addons/base/res/res_user.py
+++ b/bin/addons/base/res/res_user.py
@@ -301,8 +301,16 @@ class users(osv.osv):
 
     def _get_group(self,cr, uid, context=None):
         dataobj = self.pool.get('ir.model.data')
-        dummy,group_id = dataobj.get_object_reference(cr, 1, 'base', 'group_user')
-        return [group_id]
+        result = []
+        try:
+            dummy,group_id = dataobj.get_object_reference(cr, 1, 'base', 'group_user')
+            result.append(group_id)
+            dummy,group_id = dataobj.get_object_reference(cr, 1, 'base', 'group_partner_manager')
+            result.append(group_id)
+        except ValueError:
+            # If these groups does not exists anymore
+            pass
+        return result
 
     _defaults = {
         'password' : lambda *a : '',
-- 
GitLab