Merge lp:~dreis-pt/project-service/7.0-baseuser-dr into lp:~project-core-editors/project-service/trunk
- 7.0-baseuser-dr
- Merge into trunk
Proposed by
Daniel Reis
Status: | Merged |
---|---|
Merged at revision: | 28 |
Proposed branch: | lp:~dreis-pt/project-service/7.0-baseuser-dr |
Merge into: | lp:~project-core-editors/project-service/trunk |
Diff against target: |
511 lines (+446/-0) 12 files modified
project_baseuser/__init__.py (+2/-0) project_baseuser/__openerp__.py (+96/-0) project_baseuser/i18n/project_baseuser.pot (+21/-0) project_baseuser/project_view.xml (+12/-0) project_baseuser/security/ir.model.access.csv (+8/-0) project_baseuser/security/project_security.xml (+118/-0) project_issue_baseuser/__init__.py (+3/-0) project_issue_baseuser/__openerp__.py (+46/-0) project_issue_baseuser/i18n/project_issue_baseuser.pot (+21/-0) project_issue_baseuser/project_issue.py (+43/-0) project_issue_baseuser/security/ir.model.access.csv (+4/-0) project_issue_baseuser/security/project_security.xml (+72/-0) |
To merge this branch: | bzr merge lp:~dreis-pt/project-service/7.0-baseuser-dr |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maxime Chambreuil (http://www.savoirfairelinux.com) | code review | Approve | |
Joël Grand-Guillaume @ camptocamp | code review, no tests | Approve | |
Review via email: mp+195183@code.launchpad.net |
Commit message
Description of the change
Added new features: Extend Project user roles to support more complex use cases.
Highlights:
* Regular "Employees" can create Tasks or Issues, but have read-only access when they are initiated.
* Projects can be private to a particular Manager and Team (Project Manager no longer sees everything from everyone)
It's being used in a production instance right now.
To post a comment you must log in.
- 29. By Daniel Reis
-
Add i18n pot files; minor adjustments
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
review:
Approve
(code review, no tests)
- 30. By Daniel Reis
-
Fix encoding -> coding
Revision history for this message
Daniel Reis (dreis-pt) wrote : | # |
Fixed.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
review:
Approve
(code review)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'project_baseuser' |
2 | === added file 'project_baseuser/__init__.py' |
3 | --- project_baseuser/__init__.py 1970-01-01 00:00:00 +0000 |
4 | +++ project_baseuser/__init__.py 2013-12-16 09:26:49 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +# -*- coding: utf-8 -*- |
7 | +pass |
8 | |
9 | === added file 'project_baseuser/__openerp__.py' |
10 | --- project_baseuser/__openerp__.py 1970-01-01 00:00:00 +0000 |
11 | +++ project_baseuser/__openerp__.py 2013-12-16 09:26:49 +0000 |
12 | @@ -0,0 +1,96 @@ |
13 | +# -*- coding: utf-8 -*- |
14 | +############################################################################## |
15 | +# |
16 | +# Daniel Reis, 2013 |
17 | +# |
18 | +# This program is free software: you can redistribute it and/or modify |
19 | +# it under the terms of the GNU Affero General Public License as published by |
20 | +# the Free Software Foundation, either version 3 of the License, or |
21 | +# (at your option) any later version. |
22 | +# |
23 | +# This program is distributed in the hope that it will be useful, |
24 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
25 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26 | +# GNU Affero General Public License for more details. |
27 | +# |
28 | +# You should have received a copy of the GNU Affero General Public License |
29 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
30 | +# |
31 | +############################################################################## |
32 | + |
33 | +{ |
34 | + 'name': 'Projects extensions for user roles', |
35 | + 'version': '1.0', |
36 | + 'category': 'Project Management', |
37 | + 'summary': 'Extend Project user roles to support more complex use cases', |
38 | + 'description': """\ |
39 | +Employees are now basic Project users, able to create new documents (Issues |
40 | +or Tasks). These are kept editable while in New and Cancelled states, to |
41 | +allow for corrections or for the user himself to cancel an incorretly |
42 | +created request. |
43 | +Previously, Employee users did not have any write nor craete access to project |
44 | +documents. |
45 | + |
46 | +Project Users, on the other hand, are supposed to act on these documents, |
47 | +sucha as reported issues, and update them accordingly, so they have write |
48 | +access for all states. Employee users don't have write access on later states, |
49 | +but can still write comments and communicate through the message board (open |
50 | +chatter). |
51 | + |
52 | +In general, users will only be able to see documents where: |
53 | + |
54 | + * They are assigned/responsible for, or |
55 | + * They are following, or |
56 | + * They are a team member for the corresponding Project (but not if only in |
57 | + the project's follower list). |
58 | + |
59 | + |
60 | +Project Managers have access rules similar to Project Users, but additionally |
61 | +can create new projects and can see all documents for the projects they are |
62 | +the Manager. |
63 | +As a consequence, Project Managers no longer have inconditional access to all |
64 | +Tasks and Issues, and will only be able to edit the definitions of Projects |
65 | +they manage. |
66 | + |
67 | +This makes it possible for a Project Manager to have private projects that |
68 | +other users, Project Managers inlcuded, will not be able to see. They will |
69 | +need to be added as followers or team members to able to see it. |
70 | + |
71 | +Public Projects and their documents are still visible to everyone. |
72 | +Portal users access rules are kept unchanged. |
73 | + |
74 | + |
75 | +--------------------- |
76 | +Access Rules summary: |
77 | +--------------------- |
78 | + |
79 | +Employee Users |
80 | + Can see only documents followed or responebile for (in "user_id"). |
81 | + Can create new documents and edit them while in "New"/"Cancelled" states. |
82 | + |
83 | +Project Users |
84 | + Can edit Project Issues and Tasks in any stage/state. |
85 | + Can see all documents for projects they are followers on team memebers. |
86 | + Can see only documents followed or assigned to for other projects. |
87 | + |
88 | +Project Managers |
89 | + Can create new projects and edit their attributes. |
90 | + Can see all documents (Tasks or Issues) but only for their managed |
91 | + projects. |
92 | + For the other Projects, will see only followed documents, just like the |
93 | + other users. |
94 | + |
95 | +""", |
96 | + 'author': 'Daniel Reis', |
97 | + 'depends': [ |
98 | + 'project', |
99 | + ], |
100 | + 'data': [ |
101 | + 'project_view.xml', |
102 | + 'security/ir.model.access.csv', |
103 | + 'security/project_security.xml', |
104 | + ], |
105 | + 'installable': True, |
106 | +} |
107 | + |
108 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
109 | |
110 | === added directory 'project_baseuser/i18n' |
111 | === added file 'project_baseuser/i18n/project_baseuser.pot' |
112 | --- project_baseuser/i18n/project_baseuser.pot 1970-01-01 00:00:00 +0000 |
113 | +++ project_baseuser/i18n/project_baseuser.pot 2013-12-16 09:26:49 +0000 |
114 | @@ -0,0 +1,21 @@ |
115 | +# Translation of OpenERP Server. |
116 | +# This file contains the translation of the following modules: |
117 | +# |
118 | +msgid "" |
119 | +msgstr "" |
120 | +"Project-Id-Version: OpenERP Server 7.0\n" |
121 | +"Report-Msgid-Bugs-To: \n" |
122 | +"POT-Creation-Date: 2013-11-14 09:32+0000\n" |
123 | +"PO-Revision-Date: 2013-11-14 09:32+0000\n" |
124 | +"Last-Translator: <>\n" |
125 | +"Language-Team: \n" |
126 | +"MIME-Version: 1.0\n" |
127 | +"Content-Type: text/plain; charset=UTF-8\n" |
128 | +"Content-Transfer-Encoding: \n" |
129 | +"Plural-Forms: \n" |
130 | + |
131 | +#. module: project_baseuser |
132 | +#: model:ir.model,name:project_baseuser.model_project_task |
133 | +msgid "Task" |
134 | +msgstr "" |
135 | + |
136 | |
137 | === added file 'project_baseuser/project_view.xml' |
138 | --- project_baseuser/project_view.xml 1970-01-01 00:00:00 +0000 |
139 | +++ project_baseuser/project_view.xml 2013-12-16 09:26:49 +0000 |
140 | @@ -0,0 +1,12 @@ |
141 | +<?xml version="1.0"?> |
142 | +<openerp> |
143 | + <data> |
144 | + |
145 | + <!-- Top menu item also visible for Employees --> |
146 | + <menuitem name="Project" |
147 | + id="base.menu_main_pm" |
148 | + groups="project.group_project_manager,project.group_project_user,base.group_user" |
149 | + sequence="40"/> |
150 | + |
151 | + </data> |
152 | +</openerp> |
153 | |
154 | === added directory 'project_baseuser/security' |
155 | === added file 'project_baseuser/security/ir.model.access.csv' |
156 | --- project_baseuser/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
157 | +++ project_baseuser/security/ir.model.access.csv 2013-12-16 09:26:49 +0000 |
158 | @@ -0,0 +1,8 @@ |
159 | +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
160 | +access_project_empl,project_empl,project.model_project_project,base.group_user,1,0,0,0 |
161 | +access_account_analytic_account_empl,account_analytic_account_empl,analytic.model_account_analytic_account,base.group_user,1,0,0,0 |
162 | +access_project_task_empl,project.task.employees,project.model_project_task,base.group_user,1,1,1,0 |
163 | +access_project_task_type_empl,project.task.type.employees,project.model_project_task_type,base.group_user,1,0,0,0 |
164 | +access_project_task_work_empl,project.task.work.employees,project.model_project_task_work,base.group_user,1,0,0,0 |
165 | +access_project_task_history_empl,project.task.history.employees,project.model_project_task_history,base.group_user,1,0,1,0 |
166 | +access_project_task_hist_cum_empl,project.task.history.cumulative.employees,project.model_project_task_history_cumulative,base.group_user,1,0,1,0 |
167 | |
168 | === added file 'project_baseuser/security/project_security.xml' |
169 | --- project_baseuser/security/project_security.xml 1970-01-01 00:00:00 +0000 |
170 | +++ project_baseuser/security/project_security.xml 2013-12-16 09:26:49 +0000 |
171 | @@ -0,0 +1,118 @@ |
172 | +<?xml version="1.0" coding="utf-8"?> |
173 | +<openerp> |
174 | + <data noupdate="1"> |
175 | + |
176 | + <!-- |
177 | + PROJECT access rules |
178 | + --> |
179 | + |
180 | + <!-- Project Managers (modified): no longer see all projects: will have same visibility rules as Project Users --> |
181 | + <record model="ir.rule" id="project.project_project_manager_rule"> |
182 | + <field name="name">Project: project manager: does not see all (modified)</field> |
183 | + <field name="domain_force">[]</field> |
184 | + <!-- Original data: |
185 | + <field name="model_id" ref="model_project_project"/> |
186 | + <field name="domain_force">[(1, '=', 1)]</field> |
187 | + <field name="groups" eval="[(4,ref('project.group_project_manager'))]"/> |
188 | + --> |
189 | + <field name="perm_read" eval="True"/> |
190 | + <field name="perm_create" eval="False"/> |
191 | + <field name="perm_write" eval="False"/> |
192 | + <field name="perm_unlink" eval="False"/> |
193 | + </record> |
194 | + |
195 | + |
196 | + <!-- Project Managers (new): can edit only managed projects --> |
197 | + <record model="ir.rule" id="project_project_manager_rule_write"> |
198 | + <field name="name">Project: project manager: EDIT only managed projects</field> |
199 | + <field name="model_id" ref="project.model_project_project"/> |
200 | + <field name="domain_force">[('user_id', '=', user.id)]</field> |
201 | + <field name="groups" eval="[(4,ref('project.group_project_manager'))]"/> |
202 | + <field name="perm_read" eval="True"/> |
203 | + <field name="perm_create" eval="True"/> |
204 | + <field name="perm_write" eval="True"/> |
205 | + <field name="perm_unlink" eval="True"/> |
206 | + </record> |
207 | + |
208 | + |
209 | + <!-- Employees (modified): Projects also visible to team members not in followers list --> |
210 | + <record model="ir.rule" id="project.project_public_members_rule"> |
211 | + <field name="name">Project: employees: public, employees, followers or team members (modified)</field> |
212 | + <field name="domain_force">['|','|', |
213 | + ('privacy_visibility', 'in', ['public', 'portal', 'employees']), |
214 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
215 | + ('members', 'in', [user.id]), |
216 | + ]</field> |
217 | + </record> |
218 | + |
219 | + |
220 | + <!-- |
221 | + TASK access rules |
222 | + --> |
223 | + |
224 | + <!-- Project Managers (modified): no longer sees all Tasks - only so for Projects they Manage --> |
225 | + <record model="ir.rule" id="project.project_manager_all_project_tasks_rule"> |
226 | + <field name="name">Project/Task: project manager: see all in managed projects (modified)</field> |
227 | + <field name="domain_force">[('project_id.user_id', '=', user.id)]</field> |
228 | + <!-- Original data: |
229 | + <field name="model_id" ref="model_project_task"/> |
230 | + <field name="domain_force">[(1, '=', 1)]</field> |
231 | + <field name="groups" eval="[(4,ref('project.group_project_manager'))]"/> |
232 | + --> |
233 | + </record> |
234 | + |
235 | + |
236 | + <!-- Project Users (new): can access public, followed/member or assigned --> |
237 | + <record model="ir.rule" id="task_project_user_visibility_rule"> |
238 | + <field name="name">Project/Task: project users: public, followed/member or assigned</field> |
239 | + <field name="model_id" ref="project.model_project_task"/> |
240 | + <field name="domain_force">['|','|','|', |
241 | + ('user_id', '=', user.id), |
242 | + ('project_id.privacy_visibility', 'in', ['public']), |
243 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
244 | + ('project_id.members', 'in', [user.id]), |
245 | + ]</field> |
246 | + <field name="groups" eval="[(4,ref('project.group_project_user'))]"/> |
247 | + <field name="perm_read" eval="True"/> |
248 | + <field name="perm_create" eval="True"/> |
249 | + <field name="perm_write" eval="True"/> |
250 | + <field name="perm_unlink" eval="False"/> |
251 | + </record> |
252 | + |
253 | + |
254 | + <!-- Employees (modified): can access public or followed; can edit only in "draft" and "cancelled" states --> |
255 | + <record model="ir.rule" id="project.task_visibility_rule"> |
256 | + <field name="name">Project/Task: employees READ: public or followed /member</field> |
257 | + <field name="domain_force">['|','|','|', |
258 | + ('user_id', '=', user.id), |
259 | + ('project_id.privacy_visibility', 'in', ['public']), |
260 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
261 | + ('project_id.members', 'in', [user.id]), |
262 | + ]</field> |
263 | + <field name="perm_read" eval="True"/> |
264 | + <field name="perm_create" eval="False"/> |
265 | + <field name="perm_write" eval="False"/> |
266 | + <field name="perm_unlink" eval="False"/> |
267 | + </record> |
268 | + |
269 | + |
270 | + <!-- Employees (new, for limited edit access): can edit public or followed/member, if in "draft" or "cancelled" states --> |
271 | + <record model="ir.rule" id="task_visibility_rule_write"> |
272 | + <field name="name">Project/Task: employees WRITE: public or followed/member</field> |
273 | + <field name="model_id" ref="project.model_project_task"/> |
274 | + <field name="domain_force">['&', ('stage_id.state', 'in', ['draft', 'cancelled', None]), |
275 | + '|','|','|', |
276 | + ('user_id', '=', user.id), |
277 | + ('project_id.privacy_visibility', 'in', ['public']), |
278 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
279 | + ('project_id.members', 'in', [user.id]), |
280 | + ]</field> |
281 | + <field name="groups" eval="[(4,ref('base.group_user'))]"/> |
282 | + <field name="perm_read" eval="True"/> |
283 | + <field name="perm_create" eval="True"/> |
284 | + <field name="perm_write" eval="True"/> |
285 | + <field name="perm_unlink" eval="False"/> |
286 | + </record> |
287 | + |
288 | + </data> |
289 | +</openerp> |
290 | |
291 | === added directory 'project_issue_baseuser' |
292 | === added file 'project_issue_baseuser/__init__.py' |
293 | --- project_issue_baseuser/__init__.py 1970-01-01 00:00:00 +0000 |
294 | +++ project_issue_baseuser/__init__.py 2013-12-16 09:26:49 +0000 |
295 | @@ -0,0 +1,3 @@ |
296 | +# -*- coding: utf-8 -*- |
297 | +import project_issue |
298 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
299 | |
300 | === added file 'project_issue_baseuser/__openerp__.py' |
301 | --- project_issue_baseuser/__openerp__.py 1970-01-01 00:00:00 +0000 |
302 | +++ project_issue_baseuser/__openerp__.py 2013-12-16 09:26:49 +0000 |
303 | @@ -0,0 +1,46 @@ |
304 | +# -*- coding: utf-8 -*- |
305 | +############################################################################## |
306 | +# |
307 | +# Daniel Reis, 2013 |
308 | +# |
309 | +# This program is free software: you can redistribute it and/or modify |
310 | +# it under the terms of the GNU Affero General Public License as published by |
311 | +# the Free Software Foundation, either version 3 of the License, or |
312 | +# (at your option) any later version. |
313 | +# |
314 | +# This program is distributed in the hope that it will be useful, |
315 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
316 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
317 | +# GNU Affero General Public License for more details. |
318 | +# |
319 | +# You should have received a copy of the GNU Affero General Public License |
320 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
321 | +# |
322 | +############################################################################## |
323 | + |
324 | +{ |
325 | + 'name': 'Projects Issue extensions for user roles', |
326 | + 'version': '1.0', |
327 | + 'category': 'Project Management', |
328 | + 'summary': 'Extend Project user roles to support more complex use cases', |
329 | + 'description': """\ |
330 | +Also implements the Project user role extensions to the Project Issue |
331 | +documents. |
332 | + |
333 | +This module is automatically installed if the Issue Tracker is also installed. |
334 | +Please refer to the ``project_baseuser`` module for more details. |
335 | +""", |
336 | + 'author': 'Daniel Reis', |
337 | + 'depends': [ |
338 | + 'project_issue', |
339 | + 'project_baseuser', |
340 | + ], |
341 | + 'data': [ |
342 | + 'security/ir.model.access.csv', |
343 | + 'security/project_security.xml', |
344 | + ], |
345 | + 'installable': True, |
346 | + 'auto_install': True, |
347 | +} |
348 | + |
349 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
350 | |
351 | === added directory 'project_issue_baseuser/i18n' |
352 | === added file 'project_issue_baseuser/i18n/project_issue_baseuser.pot' |
353 | --- project_issue_baseuser/i18n/project_issue_baseuser.pot 1970-01-01 00:00:00 +0000 |
354 | +++ project_issue_baseuser/i18n/project_issue_baseuser.pot 2013-12-16 09:26:49 +0000 |
355 | @@ -0,0 +1,21 @@ |
356 | +# Translation of OpenERP Server. |
357 | +# This file contains the translation of the following modules: |
358 | +# |
359 | +msgid "" |
360 | +msgstr "" |
361 | +"Project-Id-Version: OpenERP Server 7.0\n" |
362 | +"Report-Msgid-Bugs-To: \n" |
363 | +"POT-Creation-Date: 2013-11-14 09:33+0000\n" |
364 | +"PO-Revision-Date: 2013-11-14 09:33+0000\n" |
365 | +"Last-Translator: <>\n" |
366 | +"Language-Team: \n" |
367 | +"MIME-Version: 1.0\n" |
368 | +"Content-Type: text/plain; charset=UTF-8\n" |
369 | +"Content-Transfer-Encoding: \n" |
370 | +"Plural-Forms: \n" |
371 | + |
372 | +#. module: project_issue_baseuser |
373 | +#: model:ir.model,name:project_issue_baseuser.model_project_issue |
374 | +msgid "Project Issue" |
375 | +msgstr "" |
376 | + |
377 | |
378 | === added file 'project_issue_baseuser/project_issue.py' |
379 | --- project_issue_baseuser/project_issue.py 1970-01-01 00:00:00 +0000 |
380 | +++ project_issue_baseuser/project_issue.py 2013-12-16 09:26:49 +0000 |
381 | @@ -0,0 +1,43 @@ |
382 | +# -*- coding: utf-8 -*- |
383 | +############################################################################## |
384 | +# |
385 | +# Copyright (C) 2013 Daniel Reis |
386 | +# |
387 | +# This program is free software: you can redistribute it and/or modify |
388 | +# it under the terms of the GNU Affero General Public License as |
389 | +# published by the Free Software Foundation, either version 3 of the |
390 | +# License, or (at your option) any later version. |
391 | +# |
392 | +# This program is distributed in the hope that it will be useful, |
393 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
394 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
395 | +# GNU Affero General Public License for more details. |
396 | +# |
397 | +# You should have received a copy of the GNU Affero General Public License |
398 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
399 | +# |
400 | +############################################################################## |
401 | + |
402 | +from openerp.osv import orm |
403 | + |
404 | + |
405 | +# Backport from trunk(v8) fix required. See Bug#1243628. |
406 | +class ProjectIssue(orm.Model): |
407 | + _inherit = 'project.issue' |
408 | + |
409 | + def _get_default_partner(self, cr, uid, context=None): |
410 | + """ |
411 | + If no other deafult is found, the current user is automatically |
412 | + added as the Contact for the issue. |
413 | + """ |
414 | + res = super(ProjectIssue, self |
415 | + )._get_default_partner(cr, uid, context=context) |
416 | + if not res: |
417 | + user = self.pool.get('res.users' |
418 | + ).browse(cr, uid, uid, context=context) |
419 | + res = user.partner_id and user.partner_id.id |
420 | + return res |
421 | + |
422 | + _defaults = { |
423 | + 'partner_id': lambda s, cr, uid, c: s._get_default_partner(cr, uid, c), |
424 | + } |
425 | |
426 | === added directory 'project_issue_baseuser/security' |
427 | === added file 'project_issue_baseuser/security/ir.model.access.csv' |
428 | --- project_issue_baseuser/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
429 | +++ project_issue_baseuser/security/ir.model.access.csv 2013-12-16 09:26:49 +0000 |
430 | @@ -0,0 +1,4 @@ |
431 | +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
432 | +access_project_issue_user,project.issue.employees,project_issue.model_project_issue,base.group_user,1,1,1,0 |
433 | +access_project_issue_version,project.issue.version.employee,project_issue.model_project_issue_version,base.group_user,1,0,0,0 |
434 | +access_crm_case_section,crm.case.section.employees,crm.model_crm_case_section,base.group_user,1,0,0,0 |
435 | |
436 | === added file 'project_issue_baseuser/security/project_security.xml' |
437 | --- project_issue_baseuser/security/project_security.xml 1970-01-01 00:00:00 +0000 |
438 | +++ project_issue_baseuser/security/project_security.xml 2013-12-16 09:26:49 +0000 |
439 | @@ -0,0 +1,72 @@ |
440 | +<?xml version="1.0" coding="utf-8"?> |
441 | +<openerp> |
442 | + <data noupdate="1"> |
443 | + |
444 | + |
445 | + <!-- Project Managers (modified): now can access all documents *only in own projects* --> |
446 | + <record model="ir.rule" id="project_issue.issue_project_manager_rule"> |
447 | + <field name="name">Project/Issue: project managers: sees all for Managed projects (modified)</field> |
448 | + <field name="domain_force">[('user_id', '=', user.id)]</field> |
449 | + <!-- Standard rule: |
450 | + <field name="model_id" ref="model_project_issue"/> |
451 | + <field name="domain_force">[(1, '=', 1)]</field> |
452 | + <field name="groups" eval="[(4,ref('project.group_project_manager'))]"/> |
453 | + --> |
454 | + </record> |
455 | + |
456 | + |
457 | + <!-- Project Users (new): can access public, followed/member or assigned --> |
458 | + <record model="ir.rule" id="issue_employee_rule_read"> |
459 | + <field name="name">Project/Issue: project users: public, following/member or assigned</field> |
460 | + <field name="model_id" ref="project_issue.model_project_issue"/> |
461 | + <field name="domain_force">['|', '|','|', |
462 | + ('user_id', '=', user.id), |
463 | + ('project_id.privacy_visibility', 'in', ['public']), |
464 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
465 | + ('project_id.members', 'in', [user.id]), |
466 | + ]</field> |
467 | + <field name="groups" eval="[(4,ref('project.group_project_user'))]"/> |
468 | + <field name="perm_read" eval="True"/> |
469 | + <field name="perm_create" eval="True"/> |
470 | + <field name="perm_write" eval="True"/> |
471 | + <field name="perm_unlink" eval="False"/> |
472 | + </record> |
473 | + |
474 | + |
475 | + <!-- Employees (modified): can access public or followed/member; can edit only in "draft" and "cancelled" states --> |
476 | + <record model="ir.rule" id="project_issue.issue_user_rule"> |
477 | + <field name="name">Project/Issue: employees: READ public or followed/member)</field> |
478 | + <field name="domain_force">['|','|','|', |
479 | + ('user_id', '=', user.id), |
480 | + ('project_id.privacy_visibility', 'in', ['public']), |
481 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
482 | + ('project_id.members', 'in', [user.id]), |
483 | + ]</field> |
484 | + <field name="perm_read" eval="True"/> |
485 | + <field name="perm_create" eval="False"/> |
486 | + <field name="perm_write" eval="False"/> |
487 | + <field name="perm_unlink" eval="False"/> |
488 | + </record> |
489 | + |
490 | + |
491 | + <!-- Employees (new for limited edit access): can edit public or followed/member, if in "draft" or "cancelled" states --> |
492 | + <record model="ir.rule" id="issue_employee_rule_write"> |
493 | + <field name="name">Project/Issue: employees: WRITE public or followed/member</field> |
494 | + <field name="model_id" ref="project_issue.model_project_issue"/> |
495 | + <field name="domain_force">['&', ('stage_id.state', 'in', ['draft', 'cancelled', None]), |
496 | + '|','|','|', |
497 | + ('user_id', '=', user.id), |
498 | + ('project_id.privacy_visibility', 'in', ['public']), |
499 | + ('message_follower_ids', 'in', [user.partner_id.id]), |
500 | + ('project_id.members', 'in', [user.id]), |
501 | + ]</field> |
502 | + <field name="groups" eval="[(4,ref('base.group_user'))]"/> |
503 | + <field name="perm_read" eval="True"/> |
504 | + <field name="perm_create" eval="True"/> |
505 | + <field name="perm_write" eval="True"/> |
506 | + <field name="perm_unlink" eval="False"/> |
507 | + </record> |
508 | + |
509 | + |
510 | + </data> |
511 | +</openerp> |
Hi,
Thanks for the contribs ! Just a remark:
* Line 6, 14, 173, 297, 305, 441: use -*- coding: utf-8 -*- as encoding is deprecated
Bu otherwise good, I won't block this for that. Just to let you know !
Regards,
Joël