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