From de0f1d786380a43a96af7ea46a3eef1a45cabf65 Mon Sep 17 00:00:00 2001
From: Fabien Pinckaers <fp@tinyerp.com>
Date: Mon, 10 May 2010 20:32:49 +0200
Subject: [PATCH] [FIX] multi-company

bzr revid: fp@tinyerp.com-20100510183249-s1k1c0o1umdh2m6r
---
 bin/addons/base/res/res_user.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py
index 341680a23ac8..1542b58935cb 100644
--- a/bin/addons/base/res/res_user.py
+++ b/bin/addons/base/res/res_user.py
@@ -212,7 +212,7 @@ class users(osv.osv):
 
 
     def _check_company(self, cr, uid, ids, context=None):
-        return all(this.company_id in this.company_ids for this in self.browse(cr, uid, ids, context))
+        return all(((this.company_id in this.company_ids) or not this.company_ids) for this in self.browse(cr, uid, ids, context))
 
     _constraints = [
         (_check_company, 'The chosen company is not in the allowed companies', ['company_id', 'company_ids']),
-- 
GitLab