diff --git a/addons/project/project.py b/addons/project/project.py
index 4567ba1c4b0..dabed700baf 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -507,12 +507,20 @@ class message(osv.osv):
}
message()
+def _project_get(self, cr, uid, context={}):
+ obj = self.pool.get('project.project')
+ ids = obj.search(cr, uid, [])
+ res = obj.read(cr, uid, ids, ['id','name'], context)
+ res = [(str(r['id']),r['name']) for r in res]
+ return res
+
class users(osv.osv):
_inherit = 'res.users'
- _description ="User"
+ _description = "Users"
_columns = {
- 'project_id': fields.many2one('project.project', 'Project'),
+ 'context_project_id': fields.selection(_project_get, 'Project'),
}
users()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 3b4eee97adc..6590c86d827 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -670,7 +670,7 @@ menu_main
-
+
@@ -680,9 +680,10 @@ menu_main
res.users
form
+
-
+
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index 8c1be345402..e00d72ef1ce 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -46,8 +46,8 @@
=
- user.project_id.id
- ['|',('project_id','=',False),('project_id','=',[user.project_id.id])]
+ user.context_project_id.id
+ ['|',('project_id','=',False),('project_id','=',[user.context_project_id.id])]
@@ -59,8 +59,8 @@
=
- user.project_id.id
- ['|',('task_id.project_id','=',False),('task_id.project_id','=',[user.project_id.id])]
+ user.context_project_id.id
+ ['|',('task_id.project_id','=',False),('task_id.project_id','=',[user.context_project_id.id])]
@@ -72,8 +72,8 @@
=
- user.project_id.id
- ['|',('id','=',False),('id','=',[user.project_id.id])]
+ user.context_project_id.id
+ ['|',('id','=',False),('id','=',[user.context_project_id.id])]
@@ -85,8 +85,8 @@
=
- user.project_id.id
- ['|',('project_id','=',False),('project_id','=',[user.project_id.id])]
+ user.context_project_id.id
+ ['|',('project_id','=',False),('project_id','=',[user.context_project_id.id])]