← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~dreis-pt/project-service/7.0-project_issue_reassign-dr into lp:project-service

 

Daniel Reis has proposed merging lp:~dreis-pt/project-service/7.0-project_issue_reassign-dr into lp:project-service.

Requested reviews:
  Project Core Editors (project-core-editors)

For more details, see:
https://code.launchpad.net/~dreis-pt/project-service/7.0-project_issue_reassign-dr/+merge/195275

Module to improve Issue reassignment to other Projects or Users.
-- 
https://code.launchpad.net/~dreis-pt/project-service/7.0-project_issue_reassign-dr/+merge/195275
Your team Project Core Editors is requested to review the proposed merge of lp:~dreis-pt/project-service/7.0-project_issue_reassign-dr into lp:project-service.
=== added directory 'project_issue_reassign'
=== added file 'project_issue_reassign/__init__.py'
--- project_issue_reassign/__init__.py	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/__init__.py	2013-11-14 17:50:36 +0000
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+import project
+import wizard

=== added file 'project_issue_reassign/__openerp__.py'
--- project_issue_reassign/__openerp__.py	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/__openerp__.py	2013-11-14 17:50:36 +0000
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Daniel Reis
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+    'name': 'Reassign Project Issues',
+    'summary': 'Reassign Issues to other Responsibles and Projects',
+    'version': '1.0',
+    "category": "Project Management",
+    'description': """\
+The Responsible (``user_id``) field is made read only, and can instead be
+changed through a wizard, accessible only to Project Users.
+
+Regular users (Employee group) will be able to see who is handling the request,
+but won't be able to change it.
+
+Project Users can click on the "=> Reassign" link, in front of the current
+responsible, to open a dialog where they can select the new responsible and/or
+new Project/Service Team it should be assigned to.
+
+Mass reassignments can also be made, through the context menu action on the
+Issues list view.
+""",
+    'author': 'Daniel Reis',
+    'website': '',
+    'depends': [
+        'project_issue',
+    ],
+    'data': [
+        'wizard/project_issue_reassign_view.xml',
+        'project_issue_view.xml',
+    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added directory 'project_issue_reassign/i18n'
=== added file 'project_issue_reassign/i18n/project_issue_reassign.pot'
--- project_issue_reassign/i18n/project_issue_reassign.pot	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/i18n/project_issue_reassign.pot	2013-11-14 17:50:36 +0000
@@ -0,0 +1,70 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* project_issue_reassign
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-14 16:44+0000\n"
+"PO-Revision-Date: 2013-11-14 16:44+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_issue_reassign
+#: view:project.issue:0
+msgid "⇒ Reassign"
+msgstr ""
+
+#. module: project_issue_reassign
+#: code:addons/project_issue_reassign/wizard/project_issue_reassign.py:42
+#, python-format
+msgid "No active Issues found."
+msgstr ""
+
+#. module: project_issue_reassign
+#: model:ir.actions.act_window,name:project_issue_reassign.issue_reassign_wizard_action
+msgid "Reassign Issues"
+msgstr ""
+
+#. module: project_issue_reassign
+#: model:ir.model,name:project_issue_reassign.model_project_issue_reassign
+msgid "Issue Reassign"
+msgstr ""
+
+#. module: project_issue_reassign
+#: view:project.issue.reassign:0
+msgid "_Reassign"
+msgstr ""
+
+#. module: project_issue_reassign
+#: model:ir.model,name:project_issue_reassign.model_project_issue
+msgid "Project Issue"
+msgstr ""
+
+#. module: project_issue_reassign
+#: model:ir.actions.act_window,name:project_issue_reassign.action_project_issue_reassign
+#: view:project.issue.reassign:0
+msgid "Reassign Project Issue"
+msgstr ""
+
+#. module: project_issue_reassign
+#: code:addons/project_issue_reassign/project.py:35
+#, python-format
+msgid "No reassignment data was provided."
+msgstr ""
+
+#. module: project_issue_reassign
+#: view:project.issue.reassign:0
+msgid "Cancel"
+msgstr ""
+
+#. module: project_issue_reassign
+#: view:project.issue.reassign:0
+msgid "or"
+msgstr ""
+

=== added file 'project_issue_reassign/project.py'
--- project_issue_reassign/project.py	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/project.py	2013-11-14 17:50:36 +0000
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Daniel Reis
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm
+from openerp.tools.translate import _
+
+
+class ProjectIssue(orm.Model):
+    _inherit = 'project.issue'
+
+    def do_reassign(self, cr, uid, ids, user=None, proj=None, context=None):
+        """ Reassign Isse another User and/or Project """
+        reassign_data = {}
+        if user:
+            reassign_data['user_id'] = user
+        if proj:
+            reassign_data['project_id'] = proj
+        assert reassign_data, _("No reassignment data was provided.")
+        return self.write(cr, uid, ids, reassign_data, context=context)

=== added file 'project_issue_reassign/project_issue_view.xml'
--- project_issue_reassign/project_issue_view.xml	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/project_issue_view.xml	2013-11-14 17:50:36 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+
+        <!-- Project Issue form -->
+        <record id="project_issue_form_view_reassign" model="ir.ui.view">
+            <field name="name">project_issue_form_view_reassign</field>
+            <field name="model">project.issue</field>
+            <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
+            <field name="arch" type="xml">
+
+                <!-- Important: users than can access only followed issues must
+                be left as "Responsible" upon creation, to make sure they are
+                added to the followers. Otherwise they might get an
+                access denied error -->
+                <field name="user_id" position="replace">
+                    <label for="user_id" groups="base.group_user"/>
+                    <span>
+                        <field name="user_id" class="oe_inline" readonly="1"
+                               groups="base.group_user"/>
+                        <button name="%(action_project_issue_reassign)d"
+                                string="⇒ Reassign" type="action" class="oe_link"
+                                groups="project.group_project_user" states="draft,open,pending"/>
+                    </span>
+                </field>
+
+           </field>
+        </record>
+
+
+    </data>
+</openerp>

=== added directory 'project_issue_reassign/wizard'
=== added file 'project_issue_reassign/wizard/__init__.py'
--- project_issue_reassign/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/wizard/__init__.py	2013-11-14 17:50:36 +0000
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+import project_issue_reassign

=== added file 'project_issue_reassign/wizard/project_issue_reassign.py'
--- project_issue_reassign/wizard/project_issue_reassign.py	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/wizard/project_issue_reassign.py	2013-11-14 17:50:36 +0000
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Daniel Reis
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv
+from openerp.tools.translate import _
+
+
+class project_issue_reassign(osv.TransientModel):
+    _name = 'project.issue.reassign'
+    _description = 'Issue Reassign'
+
+    _columns = {
+        'project_id': fields.many2one(
+            'project.project', 'Project',
+            help="Project this issue should belong to"),
+        'user_id': fields.many2one(
+            'res.users', 'Assign To',
+            help="User you want to assign this issue to"),
+        }
+
+    def reassign(self, cr, uid, ids, context=None):
+        if context is None:
+            context = {}
+        issue_ids = context.get('active_ids') or [context.get('active_id')]
+        assert issue_ids, _("No active Issues found.")
+        assign_to = self.browse(cr, uid, ids, context=context)[0]
+        return self.pool.get('project.issue').do_reassign(
+            cr, uid, issue_ids,
+            assign_to.user_id and assign_to.user_id.id or None,
+            assign_to.project_id and assign_to.project_id.id or None,
+            context=context)

=== added file 'project_issue_reassign/wizard/project_issue_reassign_view.xml'
--- project_issue_reassign/wizard/project_issue_reassign_view.xml	1970-01-01 00:00:00 +0000
+++ project_issue_reassign/wizard/project_issue_reassign_view.xml	2013-11-14 17:50:36 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_project_issue_reassign" model="ir.ui.view">
+            <field name="name">Reassign Project Issue</field>
+            <field name="model">project.issue.reassign</field>
+            <field name="arch" type="xml">
+
+                <form string="Reassign Project Issue" version="7.0">
+                    <group>
+                        <field name="user_id"/>
+                        <field name="project_id"/>
+                    </group>
+                    <footer>
+                         <button name="reassign" string="_Reassign" type="object" class="oe_highlight"/>
+                         or
+                         <button string="Cancel" class="oe_link" special="cancel"/>
+                    </footer>
+                </form>
+
+            </field>
+        </record>
+
+        <!-- action to call from Issue form button -->
+        <record id="action_project_issue_reassign" model="ir.actions.act_window">
+            <field name="name">Reassign Project Issue</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">project.issue.reassign</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="view_project_issue_reassign"/>
+            <field name="target">new</field>
+        </record>
+
+        <!-- wizard action on Issue context menu -->
+        <act_window id="issue_reassign_wizard_action"
+            name="Reassign Issues"
+            src_model="project.issue"
+            res_model="project.issue.reassign"
+            view_type="form" view_mode="form"
+            key2="client_action_multi" target="new"
+            groups="project.group_project_user"/>
+
+    </data>
+</openerp>


Follow ups