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
=== added directory 'project_issue_department'
=== added file 'project_issue_department/__init__.py'
--- project_issue_department/__init__.py 1970-01-01 00:00:00 +0000
+++ project_issue_department/__init__.py 2013-11-15 15:46:42 +0000
@@ -0,0 +1,3 @@
1# -*- coding: utf-8 -*-
2import project_issue
3# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
04
=== added file 'project_issue_department/__openerp__.py'
--- project_issue_department/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_issue_department/__openerp__.py 2013-11-15 15:46:42 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Daniel Reis
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20{
21 'name': 'Project Issue with Department',
22 'version': '1.1',
23 "category": "Project Management",
24 'description': """\
25Add Department field to Project Issues.
26
27Selecting a Project for an issue will automatically populate this with the
28Project's defined Department.
29""",
30 'author': 'Daniel Reis',
31 'website': 'daniel.reis@securitas.pt',
32 'depends': [
33 'project_issue',
34 'project_department',
35 ],
36 'update_xml': [
37 'project_issue_view.xml',
38 'security/ir.model.access.csv',
39 ],
40 'installable': True,
41 'application': False,
42 'auto_install': True,
43}
44# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
045
=== added directory 'project_issue_department/i18n'
=== added file 'project_issue_department/i18n/project_issue_department.pot'
--- project_issue_department/i18n/project_issue_department.pot 1970-01-01 00:00:00 +0000
+++ project_issue_department/i18n/project_issue_department.pot 2013-11-15 15:46:42 +0000
@@ -0,0 +1,16 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3#
4msgid ""
5msgstr ""
6"Project-Id-Version: OpenERP Server 7.0\n"
7"Report-Msgid-Bugs-To: \n"
8"POT-Creation-Date: 2013-11-15 14:42+0000\n"
9"PO-Revision-Date: 2013-11-15 14:42+0000\n"
10"Last-Translator: <>\n"
11"Language-Team: \n"
12"MIME-Version: 1.0\n"
13"Content-Type: text/plain; charset=UTF-8\n"
14"Content-Transfer-Encoding: \n"
15"Plural-Forms: \n"
16
017
=== added file 'project_issue_department/project_issue.py'
--- project_issue_department/project_issue.py 1970-01-01 00:00:00 +0000
+++ project_issue_department/project_issue.py 2013-11-15 15:46:42 +0000
@@ -0,0 +1,47 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Daniel Reis
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from openerp.osv import fields, orm
22
23
24class ProjectIssue(orm.Model):
25 _inherit = 'project.issue'
26 _columns = {
27 'department_id': fields.many2one('hr.department', 'Department'),
28 }
29
30 def on_change_project(self, cr, uid, ids, proj_id=False, context=None):
31 """When Project is changed: copy it's Department to the issue."""
32 res = super(ProjectIssue, self).on_change_project(
33 cr, uid, ids, proj_id, context=context)
34 res.setdefault('value', {})
35
36 if proj_id:
37 proj = self.pool.get('project.project').browse(
38 cr, uid, proj_id, context)
39 dept = getattr(proj, 'department_id', None)
40 if dept:
41 res['value'].update({'department_id': dept.id})
42 else:
43 res['value'].update({'department_id': None})
44
45 return res
46
47# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
048
=== added file 'project_issue_department/project_issue_view.xml'
--- project_issue_department/project_issue_view.xml 1970-01-01 00:00:00 +0000
+++ project_issue_department/project_issue_view.xml 2013-11-15 15:46:42 +0000
@@ -0,0 +1,48 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!--PROJECT ISSUE FORM -->
6 <record id="project_issue_department_form_view" model="ir.ui.view">
7 <field name="name">project_issue_department_form_view</field>
8 <field name="model">project.issue</field>
9 <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
10 <field name="arch" type="xml">
11 <field name="priority" position="after">
12 <field name="department_id"/>
13 </field>
14 </field>
15 </record>
16
17 <!--PROJECT ISSUE SEARCH -->
18 <record id="view_project_issue_filter_dreis" model="ir.ui.view">
19 <field name="name">Project Issue Tracker Search</field>
20 <field name="model">project.issue</field>
21 <field name="inherit_id" ref="project_issue.view_project_issue_filter"/>
22 <field name="arch" type="xml">
23 <field name="user_id" position="after">
24 <field name="department_id"/>
25 </field>
26 <!-- GROUP BY -->
27 <filter string="Project" position="after">
28 <filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
29 </filter>
30 </field>
31 </record>
32
33 <!--PROJECT ISSUE TREE -->
34 <record model="ir.ui.view" id="project_issue_tree_view_reis">
35 <field name="name">Project Issue Tracker Tree</field>
36 <field name="model">project.issue</field>
37 <field name="inherit_id" ref="project_issue.project_issue_tree_view"/>
38 <field name="arch" type="xml">
39 <data>
40 <field name="user_id" position="after">
41 <field name="department_id"/>
42 </field>
43 </data>
44 </field>
45 </record>
46
47 </data>
48</openerp>
049
=== added directory 'project_issue_department/security'
=== added file 'project_issue_department/security/ir.model.access.csv'
--- project_issue_department/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ project_issue_department/security/ir.model.access.csv 2013-11-15 15:46:42 +0000
@@ -0,0 +1,3 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_hr_department_project_manager","hr_department_project_manager","hr.model_hr_department","project.group_project_manager",1,0,0,0
3"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