Merge lp:~dreis-pt/department-mgmt/project-issue into lp:~department-core-editors/department-mgmt/7.0

Proposed by Daniel Reis
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 17
Merged at revision: 17
Proposed branch: lp:~dreis-pt/department-mgmt/project-issue
Merge into: lp:~department-core-editors/department-mgmt/7.0
Diff against target: 193 lines (+161/-0)
6 files modified
project_issue_department/__init__.py (+3/-0)
project_issue_department/__openerp__.py (+44/-0)
project_issue_department/i18n/project_issue_department.pot (+16/-0)
project_issue_department/project_issue.py (+47/-0)
project_issue_department/project_issue_view.xml (+48/-0)
project_issue_department/security/ir.model.access.csv (+3/-0)
To merge this branch: bzr merge lp:~dreis-pt/department-mgmt/project-issue
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no tests Approve
Omar (Pexego) code review, no test Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Needs Fixing
Guewen Baconnier @ Camptocamp Needs Fixing
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+175079@code.launchpad.net

Description of the change

New module to add Department to Project Issues.

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Thanks !

LGTM

review: Approve (code review, no tests)
Revision history for this message
Daniel Reis (dreis-pt) wrote :

Did some fixes. Ready for review now.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks

l.84 can you use the complete namespace i.e. from openerp.osv import fields, orm ?

review: Needs Fixing
14. By Daniel Reis

Fix complete namespace for openerp.osv

15. By Daniel Reis

Fix whitespace

Revision history for this message
Daniel Reis (dreis-pt) wrote :

Fixed.

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Hello Daniel,

Please add the translation file to this module.

Thanks!

review: Needs Fixing (code review)
16. By Daniel Reis

Add .pot file

17. By Daniel Reis

Fix child_of operator on Department's filter made it not work at all

Revision history for this message
Daniel Reis (dreis-pt) wrote :

Done!

Revision history for this message
Omar (Pexego) (omar7r) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

review: Approve (code review, no tests)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'project_issue_department'
2=== added file 'project_issue_department/__init__.py'
3--- project_issue_department/__init__.py 1970-01-01 00:00:00 +0000
4+++ project_issue_department/__init__.py 2013-11-15 15:46:42 +0000
5@@ -0,0 +1,3 @@
6+# -*- coding: utf-8 -*-
7+import project_issue
8+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
9
10=== added file 'project_issue_department/__openerp__.py'
11--- project_issue_department/__openerp__.py 1970-01-01 00:00:00 +0000
12+++ project_issue_department/__openerp__.py 2013-11-15 15:46:42 +0000
13@@ -0,0 +1,44 @@
14+# -*- coding: utf-8 -*-
15+##############################################################################
16+#
17+# Copyright (C) 2012 Daniel Reis
18+#
19+# This program is free software: you can redistribute it and/or modify
20+# it under the terms of the GNU Affero General Public License as
21+# published by the Free Software Foundation, either version 3 of the
22+# License, or (at your option) any later version.
23+#
24+# This program is distributed in the hope that it will be useful,
25+# but WITHOUT ANY WARRANTY; without even the implied warranty of
26+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+# GNU Affero General Public License for more details.
28+#
29+# You should have received a copy of the GNU Affero General Public License
30+# along with this program. If not, see <http://www.gnu.org/licenses/>.
31+#
32+##############################################################################
33+{
34+ 'name': 'Project Issue with Department',
35+ 'version': '1.1',
36+ "category": "Project Management",
37+ 'description': """\
38+Add Department field to Project Issues.
39+
40+Selecting a Project for an issue will automatically populate this with the
41+Project's defined Department.
42+""",
43+ 'author': 'Daniel Reis',
44+ 'website': 'daniel.reis@securitas.pt',
45+ 'depends': [
46+ 'project_issue',
47+ 'project_department',
48+ ],
49+ 'update_xml': [
50+ 'project_issue_view.xml',
51+ 'security/ir.model.access.csv',
52+ ],
53+ 'installable': True,
54+ 'application': False,
55+ 'auto_install': True,
56+}
57+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
58
59=== added directory 'project_issue_department/i18n'
60=== added file 'project_issue_department/i18n/project_issue_department.pot'
61--- project_issue_department/i18n/project_issue_department.pot 1970-01-01 00:00:00 +0000
62+++ project_issue_department/i18n/project_issue_department.pot 2013-11-15 15:46:42 +0000
63@@ -0,0 +1,16 @@
64+# Translation of OpenERP Server.
65+# This file contains the translation of the following modules:
66+#
67+msgid ""
68+msgstr ""
69+"Project-Id-Version: OpenERP Server 7.0\n"
70+"Report-Msgid-Bugs-To: \n"
71+"POT-Creation-Date: 2013-11-15 14:42+0000\n"
72+"PO-Revision-Date: 2013-11-15 14:42+0000\n"
73+"Last-Translator: <>\n"
74+"Language-Team: \n"
75+"MIME-Version: 1.0\n"
76+"Content-Type: text/plain; charset=UTF-8\n"
77+"Content-Transfer-Encoding: \n"
78+"Plural-Forms: \n"
79+
80
81=== added file 'project_issue_department/project_issue.py'
82--- project_issue_department/project_issue.py 1970-01-01 00:00:00 +0000
83+++ project_issue_department/project_issue.py 2013-11-15 15:46:42 +0000
84@@ -0,0 +1,47 @@
85+# -*- coding: utf-8 -*-
86+##############################################################################
87+#
88+# Copyright (C) 2012 Daniel Reis
89+#
90+# This program is free software: you can redistribute it and/or modify
91+# it under the terms of the GNU Affero General Public License as
92+# published by the Free Software Foundation, either version 3 of the
93+# License, or (at your option) any later version.
94+#
95+# This program is distributed in the hope that it will be useful,
96+# but WITHOUT ANY WARRANTY; without even the implied warranty of
97+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98+# GNU Affero General Public License for more details.
99+#
100+# You should have received a copy of the GNU Affero General Public License
101+# along with this program. If not, see <http://www.gnu.org/licenses/>.
102+#
103+##############################################################################
104+
105+from openerp.osv import fields, orm
106+
107+
108+class ProjectIssue(orm.Model):
109+ _inherit = 'project.issue'
110+ _columns = {
111+ 'department_id': fields.many2one('hr.department', 'Department'),
112+ }
113+
114+ def on_change_project(self, cr, uid, ids, proj_id=False, context=None):
115+ """When Project is changed: copy it's Department to the issue."""
116+ res = super(ProjectIssue, self).on_change_project(
117+ cr, uid, ids, proj_id, context=context)
118+ res.setdefault('value', {})
119+
120+ if proj_id:
121+ proj = self.pool.get('project.project').browse(
122+ cr, uid, proj_id, context)
123+ dept = getattr(proj, 'department_id', None)
124+ if dept:
125+ res['value'].update({'department_id': dept.id})
126+ else:
127+ res['value'].update({'department_id': None})
128+
129+ return res
130+
131+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
132
133=== added file 'project_issue_department/project_issue_view.xml'
134--- project_issue_department/project_issue_view.xml 1970-01-01 00:00:00 +0000
135+++ project_issue_department/project_issue_view.xml 2013-11-15 15:46:42 +0000
136@@ -0,0 +1,48 @@
137+<?xml version="1.0" encoding="utf-8"?>
138+<openerp>
139+ <data>
140+
141+ <!--PROJECT ISSUE FORM -->
142+ <record id="project_issue_department_form_view" model="ir.ui.view">
143+ <field name="name">project_issue_department_form_view</field>
144+ <field name="model">project.issue</field>
145+ <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
146+ <field name="arch" type="xml">
147+ <field name="priority" position="after">
148+ <field name="department_id"/>
149+ </field>
150+ </field>
151+ </record>
152+
153+ <!--PROJECT ISSUE SEARCH -->
154+ <record id="view_project_issue_filter_dreis" model="ir.ui.view">
155+ <field name="name">Project Issue Tracker Search</field>
156+ <field name="model">project.issue</field>
157+ <field name="inherit_id" ref="project_issue.view_project_issue_filter"/>
158+ <field name="arch" type="xml">
159+ <field name="user_id" position="after">
160+ <field name="department_id"/>
161+ </field>
162+ <!-- GROUP BY -->
163+ <filter string="Project" position="after">
164+ <filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
165+ </filter>
166+ </field>
167+ </record>
168+
169+ <!--PROJECT ISSUE TREE -->
170+ <record model="ir.ui.view" id="project_issue_tree_view_reis">
171+ <field name="name">Project Issue Tracker Tree</field>
172+ <field name="model">project.issue</field>
173+ <field name="inherit_id" ref="project_issue.project_issue_tree_view"/>
174+ <field name="arch" type="xml">
175+ <data>
176+ <field name="user_id" position="after">
177+ <field name="department_id"/>
178+ </field>
179+ </data>
180+ </field>
181+ </record>
182+
183+ </data>
184+</openerp>
185
186=== added directory 'project_issue_department/security'
187=== added file 'project_issue_department/security/ir.model.access.csv'
188--- project_issue_department/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
189+++ project_issue_department/security/ir.model.access.csv 2013-11-15 15:46:42 +0000
190@@ -0,0 +1,3 @@
191+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
192+"access_hr_department_project_manager","hr_department_project_manager","hr.model_hr_department","project.group_project_manager",1,0,0,0
193+"access_hr_department_project_user","hr_department_project_user","hr.model_hr_department","project.group_project_user",1,0,0,0

Subscribers

People subscribed via source and target branches