Merge lp:~dreis-pt/project-service/7.0-issue_task-dr into lp:~project-core-editors/project-service/trunk

Proposed by Daniel Reis
Status: Merged
Merged at revision: 38
Proposed branch: lp:~dreis-pt/project-service/7.0-issue_task-dr
Merge into: lp:~project-core-editors/project-service/trunk
Diff against target: 1627 lines (+467/-922)
21 files modified
project_issue_service/board_project_view.xml (+0/-12)
project_issue_service/project_issue_workflow.xml (+0/-108)
project_issue_service/wizard/__init__.py (+0/-1)
project_issue_service/wizard/project_task_reevaluate.py (+0/-38)
project_issue_task/__init__.py (+3/-4)
project_issue_task/__openerp__.py (+20/-27)
project_issue_task/i18n/fr.po (+97/-0)
project_issue_task/i18n/project_issue_task.pot (+97/-0)
project_issue_task/i18n/pt.po (+97/-0)
project_issue_task/project_issue.py (+40/-142)
project_issue_task/project_issue_view.xml (+9/-163)
project_issue_task/project_task.py (+34/-71)
project_issue_task/project_task_cause.py (+6/-10)
project_issue_task/project_task_cause_view.xml (+19/-10)
project_issue_task/project_task_view.xml (+14/-39)
project_issue_task/security/ir.model.access.csv (+1/-1)
project_issue_task/security/project_security.xml (+30/-0)
project_task_service/__init__.py (+0/-4)
project_task_service/__openerp__.py (+0/-52)
project_task_service/project_task.py (+0/-88)
project_task_service/project_task_view.xml (+0/-152)
To merge this branch: bzr merge lp:~dreis-pt/project-service/7.0-issue_task-dr
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review Approve
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Yannick Vaucher @ Camptocamp code review, no tests Approve
Review via email: mp+195985@code.launchpad.net

Description of the change

Module to "Use Tasks to support Issue resolution reports".
Simplifies and replaces the former v6 "project_issue_service" and "project_task_service".

To post a comment you must log in.
30. By Daniel Reis

Add french translation, credits to invitu

31. By Daniel Reis

Fixed to make the related issue a stored function field

Revision history for this message
invitu (invitu) wrote :

Dear Daniel

We think that task priority should be synchronized with issue priority

In the other way, changes in task stage should synchronize with issue stage

Please check out our MP

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

Thanks for the contribs ! I saw few little stuff here :

 * Use from . import XYZ
 * Use 'data' and 'demo' in __openerp__.py, update_xml, init_xml, etc.. are deprecated
 * Line 1018 : you miss a context propagation

Otherwise all good.

Regards,

Joël

review: Needs Fixing (code review, no tests)
32. By Daniel Reis

Fixes from code review

33. By Daniel Reis

Fix trailing empty line

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Hello Daniel,

ll.737-738 dict comprehension is not python 2.6 compatible please use dict constructor instead.

Thanks

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

Should I be required to support Python < 2.7 ?

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

As openerp is 2.6 compatible inserting 2.7 code would break the compatibility.

https://doc.openerp.com/v7.0/install/linux/server/
"Python 2.6 or later is required for OpenERP 6.1."

No further update for 7.0 was made so we should stick to 2.6 compatibility as in 6.1.

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

Yannick, that doc page states that "Python 2.6 or later is required for OpenERP 6.1".
Well, 6.1 is not officially supported by now, and I believe that neither Python 2.6.
I would like some more opinions on this. Do you think we should start a thread on the ML?

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

This can only be a good idea to launch a talk on ML. At least it can sync everyone on that subject.

34. By Daniel Reis

Changed dict comprehension into dict constructor, for python 2.6 compatibility

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

Yannick, I made the fix you suggested.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the fix and having launched the talk that was quite uncertain for everyone.

LGTM

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

OK, just need Joël's review now.

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

@Joel: I believe issues from your review have been addressed in rev 32.
Thanks!

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

This is the oldest MP on this project, and I believe that all issues have been fixed.
Unless opinions otherwise, I will go on with it's merge.

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM, Sorry for late reply, was on holidays

review: Approve (code review, no tests)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi Daniel,

I tried to merge your branch and unfortunately got a conflict.
Can you rebase from the head?

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'project_issue_service/board_project_view.xml'
--- project_issue_service/board_project_view.xml 2012-11-22 13:29:38 +0000
+++ project_issue_service/board_project_view.xml 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="project.action_project_vs_remaining_hours_graph" model="ir.actions.act_window">
6 <!-- Exclude admin's projects from graph -->
7 <field name="domain">[('user_id','!=',1),('user_id','=',uid),('state','=','open')]</field>
8 </record>
9
10 </data>
11</openerp>
12
13\ No newline at end of file0\ No newline at end of file
141
=== removed file 'project_issue_service/project_issue_workflow.xml'
--- project_issue_service/project_issue_workflow.xml 2012-11-22 13:29:38 +0000
+++ project_issue_service/project_issue_workflow.xml 1970-01-01 00:00:00 +0000
@@ -1,108 +0,0 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4 <record model="workflow" id="wkf_project_issue">
5 <field name="name">Project Issue Workflow</field>
6 <field name="osv">project.issue</field>
7 <field name="on_create">True</field>
8 </record>
9
10 <record model="workflow.activity" id="act_draft">
11 <field name="wkf_id" ref="wkf_project_issue"/>
12 <field name="flow_start">True</field>
13 <field name="name">draft</field>
14 <field name="kind">function</field>
15 <field name="action">write({'state': 'draft'})
16do_routing()</field>
17 </record>
18
19 <record model="workflow.activity" id="act_open">
20 <field name="wkf_id" ref="wkf_project_issue"/>
21 <field name="name">open</field>
22 <field name="kind">function</field>
23 <field name="action">write({'state': 'open'})
24do_routing()</field>
25 </record>
26
27 <record model="workflow.activity" id="act_pending">
28 <field name="wkf_id" ref="wkf_project_issue"/>
29 <field name="name">pending</field>
30 <field name="kind">function</field>
31 <field name="action">write({'state': 'pending'})</field>
32 </record>
33
34 <record model="workflow.activity" id="act_done">
35 <field name="wkf_id" ref="wkf_project_issue"/>
36 <field name="name">done</field>
37 <field name="kind">function</field>
38 <field name="action">write({'state': 'done'})</field>
39 <field name="flow_stop">True</field>
40 </record>
41
42 <record model="workflow.activity" id="act_cancel">
43 <field name="wkf_id" ref="wkf_project_issue"/>
44 <field name="name">cancel</field>
45 <field name="kind">function</field>
46 <field name="action">write({'state': 'cancel'})</field>
47 <field name="flow_stop">True</field>
48 </record>
49
50
51<!-- == TRANSITIONS == -->
52 <!-- DRAFT -->
53 <record model="workflow.transition" id="t_draft2cancel">
54 <field name="act_from" ref="act_draft"/>
55 <field name="act_to" ref="act_cancel"/>
56 <field name="signal">case_cancel</field>
57 </record>
58 <record model="workflow.transition" id="t_draft2open">
59 <field name="act_from" ref="act_draft"/>
60 <field name="act_to" ref="act_open"/>
61 <field name="signal">case_open</field>
62 </record>
63
64 <!-- OPEN -->
65 <record model="workflow.transition" id="t_open2done">
66 <field name="act_from" ref="act_open"/>
67 <field name="act_to" ref="act_done"/>
68 <field name="signal">case_close</field>
69 </record>
70 <record model="workflow.transition" id="t_open2pending">
71 <field name="act_from" ref="act_open"/>
72 <field name="act_to" ref="act_pending"/>
73 <field name="signal">case_pending</field>
74 </record>
75 <record model="workflow.transition" id="t_open2cancel">
76 <field name="act_from" ref="act_open"/>
77 <field name="act_to" ref="act_cancel"/>
78 <field name="signal">case_cancel</field>
79 </record>
80
81 <!-- PENDING -->
82 <record model="workflow.transition" id="t_pending2open">
83 <field name="act_from" ref="act_pending"/>
84 <field name="act_to" ref="act_open"/>
85 <field name="signal">case_open</field>
86 </record>
87
88 <!-- not valid
89 <record model="workflow.transition" id="t_done2draft">
90 <field name="act_from" ref="act_done"/>
91 <field name="act_to" ref="act_draft"/>
92 <field name="signal">case_reset</field>
93 </record>
94 <record model="workflow.transition" id="t_cancel2draft">
95 <field name="act_from" ref="act_cancel"/>
96 <field name="act_to" ref="act_draft"/>
97 <field name="signal">case_reset</field>
98 </record>
99 -->
100
101 </data>
102</openerp>
103
104
105
106
107
108
1090
=== removed directory 'project_issue_service/static'
=== removed directory 'project_issue_service/static/src'
=== removed directory 'project_issue_service/static/src/img'
=== removed file 'project_issue_service/static/src/img/icon.png'
110Binary files project_issue_service/static/src/img/icon.png 2012-11-22 13:29:38 +0000 and project_issue_service/static/src/img/icon.png 1970-01-01 00:00:00 +0000 differ1Binary files project_issue_service/static/src/img/icon.png 2012-11-22 13:29:38 +0000 and project_issue_service/static/src/img/icon.png 1970-01-01 00:00:00 +0000 differ
=== removed directory 'project_issue_service/wizard'
=== removed file 'project_issue_service/wizard/__init__.py'
--- project_issue_service/wizard/__init__.py 2012-11-22 13:29:38 +0000
+++ project_issue_service/wizard/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1import project_task_reevaluate
20
=== removed file 'project_issue_service/wizard/project_task_reevaluate.py'
--- project_issue_service/wizard/project_task_reevaluate.py 2012-11-22 13:29:38 +0000
+++ project_issue_service/wizard/project_task_reevaluate.py 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
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##############################################################################
20from osv import fields, osv
21from tools.translate import _
22
23class project_task_reevaluate(osv.osv_memory):
24 _inherit = 'project.task.reevaluate'
25
26 def compute_hours(self, cr, uid, ids, context=None):
27 """
28 Reevaluate relinks the Issue's current Task
29 """
30 task_pool = self.pool.get('project.task')
31 issue_pool = self.pool.get('project.issue')
32 for o in task_pool.browse(cr, uid, context.get('active_ids', list()), context=context):
33 if o.issue_id and not o.issue_id.task_id:
34 issue_pool.write(cr, uid, [o.issue_id.id], {'task_id': o.id}, context=context)
35 return super(project_task_reevaluate, self).compute_hours(cr, uid, ids, context)
36project_task_reevaluate()
37
38# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
390
=== renamed directory 'project_issue_service' => 'project_issue_task'
=== modified file 'project_issue_task/__init__.py' (properties changed: +x to -x)
--- project_issue_service/__init__.py 2012-11-22 13:29:38 +0000
+++ project_issue_task/__init__.py 2014-02-25 12:39:41 +0000
@@ -1,5 +1,4 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2import project_issue2from . import project_issue
3import project_task3from . import project_task_cause
4import wizard4from . import project_task
5# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
65
=== modified file 'project_issue_task/__openerp__.py' (properties changed: +x to -x)
--- project_issue_service/__openerp__.py 2013-05-09 13:35:42 +0000
+++ project_issue_task/__openerp__.py 2014-02-25 12:39:41 +0000
@@ -1,7 +1,7 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# Copyright (C) 2012 Daniel Reis4# Copyright (C) 2012 - 2013 Daniel Reis
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as7# it under the terms of the GNU Affero General Public License as
@@ -19,41 +19,34 @@
19##############################################################################19##############################################################################
2020
21{21{
22 'name': 'Project Issue and Task integration',22 'name': 'Project Issue related Tasks',
23 'summary': 'Use Tasks to support Issue resolution reports',
23 'version': '1.1',24 'version': '1.1',
24 'category': 'Project Management',25 'category': 'Project Management',
25 'description': """\26 'description': """\
26Integrate Issues and Tasks in a common workflow, as is common in service management scenarios.27Support for the use case where solving an Issue means a Task should be done,
2728such as an on site visit, and a report must be made to document the work done.
281. End user creates new Issue29This is a common scenario in technical field services.
292. Service Desk User reviews the new Issue:30
30 If a technical person intervention is needed, creates a Task for it.31The Issue form already has a "Task" field, allowing to create a Task related
31 If not, it's closed without the need for an intervention Task.32to an Issue.
323. Service Team User schedules the new Task33This module adds some usability improvements:
334. Service Team User completes the Task. The issue is automatically closed.34
3435 * "Create Task" button on the Issue form
35CHANGE LOG36 * Automaticaly Close the Issue when the Task is Closed
36============37 * Automatically Cancel the Task when Issue is Cancelled
371.1 Reference sequence (`ref` field) moved to module `project_issue_sequences`.38 * Make the Task also visible to all followers of the related Issue
38
39""",39""",
40 'author': 'Daniel Reis',40 'author': 'Daniel Reis',
41 'website': 'daniel.reis@securitas.pt',
42 'depends': [41 'depends': [
43 'project', 'project_functional_blocks',
44 'project_issue',42 'project_issue',
45 'project_issue_department',
46 'project_issue_sequences',
47 'crm_categ_hierarchy',
48 'crm',
49 ],43 ],
50 'update_xml': [44 'data': [
51 'project_issue_view.xml',45 'project_issue_view.xml',
46 'project_task_cause_view.xml',
52 'project_task_view.xml',47 'project_task_view.xml',
53 'board_project_view.xml',48 'security/ir.model.access.csv',
54 #'project_issue_workflow.xml', #<= not using it, to avoid migrating former Issues to the new workflow49 'security/project_security.xml',
55 ],50 ],
56 'installable': False,51 'installable': True,
57 'application': True,
58}52}
59# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6053
=== added directory 'project_issue_task/i18n'
=== added file 'project_issue_task/i18n/fr.po'
--- project_issue_task/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ project_issue_task/i18n/fr.po 2014-02-25 12:39:41 +0000
@@ -0,0 +1,97 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_issue_task
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-21 21:31+0000\n"
10"PO-Revision-Date: 2013-11-21 21:31+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_issue_task
19#: code:addons/project_issue_task/project_issue.py:38
20#, python-format
21msgid "Report for %s"
22msgstr "Rapport pour %s"
23
24#. module: project_issue_task
25#: view:project.issue:0
26msgid "Task Report"
27msgstr "Rapport de tâche"
28
29#. module: project_issue_task
30#: field:project.task.cause,code:0
31msgid "Code"
32msgstr "Code"
33
34#. module: project_issue_task
35#: field:project.task.cause,description:0
36msgid "Description"
37msgstr "Description"
38
39#. module: project_issue_task
40#: field:project.task,ref:0
41msgid "Reference"
42msgstr "Référence"
43
44#. module: project_issue_task
45#: model:ir.model,name:project_issue_task.model_project_issue
46msgid "Project Issue"
47msgstr "Incident"
48
49#. module: project_issue_task
50#: field:project.task.cause,sequence:0
51msgid "Sequence"
52msgstr "Sequence"
53
54#. module: project_issue_task
55#: field:project.task,reason_id:0
56msgid "Problem Cause"
57msgstr "Cause du problème"
58
59#. module: project_issue_task
60#: field:project.task,issue_id:0
61msgid "Related Issue"
62msgstr "Incident lié"
63
64#. module: project_issue_task
65#: model:ir.model,name:project_issue_task.model_project_task
66msgid "Task"
67msgstr "Tâche"
68
69#. module: project_issue_task
70#: code:addons/project_issue_task/project_issue.py:33
71#, python-format
72msgid "A Task is already assigned to the Issue!"
73msgstr "Une tâche est déjà liée à l'incident!"
74
75#. module: project_issue_task
76#: model:ir.model,name:project_issue_task.model_project_task_cause
77msgid "Issue Cause"
78msgstr "Cause de l'incident"
79
80#. module: project_issue_task
81#: field:project.task.cause,name:0
82msgid "Cause"
83msgstr "Cause"
84
85#. module: project_issue_task
86#: model:ir.actions.act_window,name:project_issue_task.open_task_cause_form
87#: model:ir.ui.menu,name:project_issue_task.menu_task_cause_view
88#: view:project.task.cause:0
89msgid "Task Issue Causes"
90msgstr "Causes des incidents"
91
92#. module: project_issue_task
93#: code:addons/project_issue_task/project_issue.py:46
94#, python-format
95msgid "Issue Task Report"
96msgstr "Rapport des tâches de l'incident"
97
098
=== added file 'project_issue_task/i18n/project_issue_task.pot'
--- project_issue_task/i18n/project_issue_task.pot 1970-01-01 00:00:00 +0000
+++ project_issue_task/i18n/project_issue_task.pot 2014-02-25 12:39:41 +0000
@@ -0,0 +1,97 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_issue_task
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-20 15:02+0000\n"
10"PO-Revision-Date: 2013-11-20 15:02+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_issue_task
19#: code:addons/project_issue_task/project_issue.py:38
20#, python-format
21msgid "Report for %s"
22msgstr ""
23
24#. module: project_issue_task
25#: view:project.issue:0
26msgid "Task Report"
27msgstr ""
28
29#. module: project_issue_task
30#: field:project.task.cause,code:0
31msgid "Code"
32msgstr ""
33
34#. module: project_issue_task
35#: field:project.task.cause,description:0
36msgid "Description"
37msgstr ""
38
39#. module: project_issue_task
40#: field:project.task,ref:0
41msgid "Reference"
42msgstr ""
43
44#. module: project_issue_task
45#: model:ir.model,name:project_issue_task.model_project_issue
46msgid "Project Issue"
47msgstr ""
48
49#. module: project_issue_task
50#: field:project.task.cause,sequence:0
51msgid "Sequence"
52msgstr ""
53
54#. module: project_issue_task
55#: field:project.task,reason_id:0
56msgid "Problem Cause"
57msgstr ""
58
59#. module: project_issue_task
60#: field:project.task,issue_id:0
61msgid "Related Issue"
62msgstr ""
63
64#. module: project_issue_task
65#: model:ir.model,name:project_issue_task.model_project_task
66msgid "Task"
67msgstr ""
68
69#. module: project_issue_task
70#: code:addons/project_issue_task/project_issue.py:33
71#, python-format
72msgid "A Task is already assigned to the Issue!"
73msgstr ""
74
75#. module: project_issue_task
76#: model:ir.model,name:project_issue_task.model_project_task_cause
77msgid "Issue Cause"
78msgstr ""
79
80#. module: project_issue_task
81#: field:project.task.cause,name:0
82msgid "Cause"
83msgstr ""
84
85#. module: project_issue_task
86#: model:ir.actions.act_window,name:project_issue_task.open_task_cause_form
87#: model:ir.ui.menu,name:project_issue_task.menu_task_cause_view
88#: view:project.task.cause:0
89msgid "Task Issue Causes"
90msgstr ""
91
92#. module: project_issue_task
93#: code:addons/project_issue_task/project_issue.py:46
94#, python-format
95msgid "Issue Task Report"
96msgstr ""
97
098
=== added file 'project_issue_task/i18n/pt.po'
--- project_issue_task/i18n/pt.po 1970-01-01 00:00:00 +0000
+++ project_issue_task/i18n/pt.po 2014-02-25 12:39:41 +0000
@@ -0,0 +1,97 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_issue_task
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-20 15:02+0000\n"
10"PO-Revision-Date: 2013-11-20 15:02+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_issue_task
19#: code:addons/project_issue_task/project_issue.py:38
20#, python-format
21msgid "Report for %s"
22msgstr "Relatório de %s"
23
24#. module: project_issue_task
25#: view:project.issue:0
26msgid "Task Report"
27msgstr "Relatório de Intervenção"
28
29#. module: project_issue_task
30#: field:project.task.cause,code:0
31msgid "Code"
32msgstr "Código"
33
34#. module: project_issue_task
35#: field:project.task.cause,description:0
36msgid "Description"
37msgstr "Descrição"
38
39#. module: project_issue_task
40#: field:project.task,ref:0
41msgid "Reference"
42msgstr "Referência"
43
44#. module: project_issue_task
45#: model:ir.model,name:project_issue_task.model_project_issue
46msgid "Project Issue"
47msgstr "Incidente"
48
49#. module: project_issue_task
50#: field:project.task.cause,sequence:0
51msgid "Sequence"
52msgstr "Sequência"
53
54#. module: project_issue_task
55#: field:project.task,reason_id:0
56msgid "Problem Cause"
57msgstr "Causa do problema"
58
59#. module: project_issue_task
60#: field:project.task,issue_id:0
61msgid "Related Issue"
62msgstr "Relativo ao Incidente"
63
64#. module: project_issue_task
65#: model:ir.model,name:project_issue_task.model_project_task
66msgid "Task"
67msgstr "Tarefa"
68
69#. module: project_issue_task
70#: code:addons/project_issue_task/project_issue.py:33
71#, python-format
72msgid "A Task is already assigned to the Issue!"
73msgstr "O Incidente já tem uma Tarefa associada!"
74
75#. module: project_issue_task
76#: model:ir.model,name:project_issue_task.model_project_task_cause
77msgid "Issue Cause"
78msgstr "Causa do Incidente"
79
80#. module: project_issue_task
81#: field:project.task.cause,name:0
82msgid "Cause"
83msgstr "Causa"
84
85#. module: project_issue_task
86#: model:ir.actions.act_window,name:project_issue_task.open_task_cause_form
87#: model:ir.ui.menu,name:project_issue_task.menu_task_cause_view
88#: view:project.task.cause:0
89msgid "Task Issue Causes"
90msgstr "Causas para Tarefas"
91
92#. module: project_issue_task
93#: code:addons/project_issue_task/project_issue.py:46
94#, python-format
95msgid "Issue Task Report"
96msgstr "Relatório de Intervenção"
97
098
=== modified file 'project_issue_task/project_issue.py' (properties changed: +x to -x)
--- project_issue_service/project_issue.py 2013-01-03 11:34:54 +0000
+++ project_issue_task/project_issue.py 2014-02-25 12:39:41 +0000
@@ -1,7 +1,7 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3# 3#
4# Copyright (C) 2012 Daniel Reis4# Copyright (C) 2012 - 2013 Daniel Reis
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as7# it under the terms of the GNU Affero General Public License as
@@ -18,147 +18,45 @@
18#18#
19##############################################################################19##############################################################################
2020
21from osv import fields, osv21from openerp.osv import orm
22from tools.translate import _22from tools.translate import _
23from datetime import datetime, timedelta23
24import time24
2525class project_issue(orm.Model):
26
27class project_issue(osv.osv):
28 _inherit = 'project.issue'26 _inherit = 'project.issue'
29 _columns = {27
30 #added fields:28 def action_create_task(self, cr, uid, ids, context=None):
31 'functional_block_id': fields.many2one('project.functional_block', 'Component', help = "Component (system, module, function) to be adressed"),29 """
32 'assigned_to': fields.related('task_id', 'user_id', string = 'Task Assigned to', type="many2one", relation="res.users", store=True, help='This is the current user to whom the related task was assigned'),30 Create and a related Task for the visit report, and open it's Form.
33 'tasks': fields.one2many('project.task', 'issue_id', 'Related tasks', help="Task history for the issue"),31 """
34 'create_uid': fields.many2one('res.users', 'Created by', help = "Person who reported the issue"),32 rec = self.browse(cr, uid, ids[0], context)
35 #modified fields:33 assert not rec.task_id, _("A Task is already assigned to the Issue!")
36 'categ_id': fields.many2one('crm.case.categ', 'Category', required=True, 34
37 domain="[('object_id.model','=','project.issue')]",35 rec_fields = ['project_id', 'analytic_account_id', 'location_id']
38 help="Only categories with a parent will be selectable in the Issues form."),36 task_data = dict([(x, getattr(rec, x).id) for x in rec_fields
39 }37 if hasattr(rec, x) and getattr(rec, x)])
4038 task_data['name'] = _('Report for %s') % rec.name
41 def case_open(self, cr, uid, ids, *args):39 task_data['issue_id'] = rec.id
42 """Open Issue preserving the assigned user_id.40 task_data['categ_ids'] = [(6, 0, [x.id for x in rec.categ_ids])]
43 Standard project_issue.case_open() method forces user_id to the current user.41
44 This is not appropriate in the case where an administrative user is updating issue status.42 task_model = self.pool.get('project.task')
45 With this enhancement, the original user_id is preserved.43 task_id = task_model.create(cr, uid, task_data, context=context)
46 """44 rec.write({'task_id': task_id}, context=context)
47 orig = self.read(cr, uid, ids, ['id', 'user_id'])45 res = {
48 res = super(project_issue, self).case_open(cr, uid, ids, *args)46 'name': _('Issue Task Report'),
49 for rec in orig:
50 if rec['user_id'] and rec['user_id'][0]:
51 #Write both 'user_id' and 'date_open' to allow Action Rule Triggers to ignore these changes using "... and not vals.get('date_open')"
52 self.write(cr, uid, [rec['id']], {'date_open': time.strftime('%Y-%m-%d %H:%M:%S'), 'user_id' : rec['user_id'][0]} )
53 return res
54
55 def _validate_tasks_inactive(self, cr, uid, ids):
56 """Ensure there are no related active Tasks"""
57 for issue in self.browse(cr, uid, ids):
58 for task in issue.tasks:
59 if task.state not in ['done', 'cancel']:
60 raise osv.except_osv(_('Error !'), _('All related tasks should be inactive. Please check Task "%s".' % task.name))
61
62 def case_cancel(self, cr, uid, ids, *args):
63 self._validate_tasks_inactive(cr, uid, ids)
64 return super(project_issue, self).case_cancel(cr, uid, ids, *args)
65
66 def case_close(self, cr, uid, ids, *args):
67 self._validate_tasks_inactive(cr, uid, ids)
68 return super(project_issue, self).case_close(cr, uid, ids, *args)
69
70 def onchange_partner_id(self, cr, uid, ids, part, email=False, proj_id=None, context=None):
71 """This function returns value of partner address based on partner
72 :param ids: List of case IDs
73 :param part: Partner's id
74 :param email: Partner's email ID
75 """
76 #the Issue Address is copied from the project's Contact Address
77 if proj_id:
78 data = {}
79 proj_obj = self.pool.get('project.project').browse(cr, uid, proj_id, context)
80 #Copy address from Project
81 contact_id = proj_obj.contact_id and proj_obj.contact_id.id or None
82 data.update( {'partner_address_id': contact_id} )
83 #Copy "reply_to" email from Project, if none already provided
84 if not email:
85 email = proj_obj.reply_to
86 if email:
87 data.update({'email_from': email})
88 return {'value': data}
89 #else:
90 return super(project_issue, self).onchange_partner_id(cr, uid, ids, part, email)
91
92 def on_change_project(self, cr, uid, ids, proj_id=False, context=None):
93 """When changing the Issue's Project:
94 - the Issue Partner is copied from the project's Partner
95 - cascades the change to the Address and e-mail
96 """
97 if not proj_id:
98 return {'value':{}}
99 super_res = super(project_issue, self).on_change_project(cr, uid, ids, proj_id, context = context)
100 data = super_res.get('value', {})
101 #the Issue Partner is copied from the project's Partner
102 proj_obj = self.pool.get('project.project').browse(cr, uid, proj_id, context)
103 if proj_obj.partner_id:
104 data.update( {'partner_id': proj_obj.partner_id.id} )
105 #the Issue Address is copied from the project's Contact Address
106 #TODO: code repeated in onchange_partner_id(); check if it's really necessary
107 contact_id = proj_obj.contact_id and proj_obj.contact_id.id or None
108 data.update( {'partner_address_id': contact_id} )
109 #cascades the change to the Address and e-mail
110 data.update( self.onchange_partner_id(cr, uid, ids, None, proj_id)['value'] )
111 return {'value': data}
112
113 def convert_issue_task(self, cr, uid, ids, context=None):
114 for bug in self.browse(cr, uid, ids, context=context):
115 if bug.task_id:
116 new_task_id = bug.task_id.id
117 else:
118 #Task,user_id must be current user; otherwise Task Access Rules may stop task.create
119 #Task date start defaults to tomorrow 00:00h
120 now = datetime.now()
121 date_start = datetime( now.year, now.month, now.day, 0) + timedelta(days=+1)
122 new_task_id = self.pool.get('project.task').create(cr, uid, {
123 'section_id': bug.section_id.id,
124 'project_id': bug.project_id.id,
125 'partner_id': bug.partner_id.id,
126 'categ_id': bug.categ_id.id,
127 'functional_block_id': bug.functional_block_id.id,
128 'date_deadline': bug.date_deadline,
129 'date_start': date_start, #changed from standard
130 'planned_hours': 1, #added
131 'name': bug.name,
132 'description':bug.description,
133 'issue_id': bug.id, #added
134 'priority': bug.priority,
135 'user_id': uid, #changed
136 })
137 self.write(cr, uid, [bug.id], {'task_id': new_task_id})
138 self.case_open(cr, uid, [bug.id])
139
140 data_obj = self.pool.get('ir.model.data')
141 form_id = data_obj.get_object(cr, uid, 'project', 'view_task_form2').id
142 tree_id = data_obj.get_object(cr, uid, 'project', 'view_task_tree2').id
143 srch_id = data_obj.get_object(cr, uid, 'project', 'view_task_search_form').id
144 return {
145 'name': _('Tasks'),
146 'view_type': 'form',47 'view_type': 'form',
147 'view_mode': 'form,tree', 48 'view_mode': 'form',
148 'res_model': 'project.task',49 'res_model': 'project.task',
149 'res_id': int(new_task_id),50 'res_id': task_id,
150 'view_id': False,51 'type': 'ir.actions.act_window'}
151 'views': [(form_id,'form'),(tree_id,'tree'),(False,'calendar'),(False,'graph')],52 return res
152 'type': 'ir.actions.act_window',53
153 'search_view_id': srch_id,54 def case_cancel(self, cr, uid, ids, context=None):
154 'nodestroy': True55 """ On Issue Cancel, also Cancel Task """
155 }56 task_ids = [issue.task_id.id
15657 for issue in self.browse(cr, uid, ids, context=context)
157 def convert_issue_task_tree(self, cr, uid, ids, context=None):58 if issue.task_id]
158 """Create Task from Issue, without opening it's form"""59 self.pool.get('project.task').case_cancel(
159 self.convert_issue_task(cr, uid, ids, context=context)60 cr, uid, task_ids, context=context)
160 return True61 return super(project_issue, self).case_cancel(
16162 cr, uid, ids, context=context)
162project_issue()
163
164# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
16563
=== modified file 'project_issue_task/project_issue_view.xml' (properties changed: +x to -x)
--- project_issue_service/project_issue_view.xml 2012-12-20 12:06:22 +0000
+++ project_issue_task/project_issue_view.xml 2014-02-25 12:39:41 +0000
@@ -1,174 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<openerp>2<openerp>
3 <data>3 <data>
4 4
5 <!--PROJECT ISSUE FORM -->5 <!--PROJECT ISSUE FORM -->
6 <record id="project_issue_form_view_dreis" model="ir.ui.view">6 <record id="project_issue_form_view_task" model="ir.ui.view">
7 <field name="name">project_issue_form_view_dreis</field>7 <field name="name">project_issue_form_view_task</field>
8 <field name="model">project.issue</field>8 <field name="model">project.issue</field>
9 <field name="inherit_id" ref="project_issue.project_issue_form_view"/>9 <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
10 <field name="arch" type="xml">10 <field name="arch" type="xml">
1111
12 <field name="categ_id" position="replace"/>12 <field name="task_id" position="after">
13 <field name="name" position="replace">13 <button type="object" name="action_create_task" string="Task Report" attrs="{'invisible': [('task_id', '!=', False)]}"/>
14 <field name="name" colspan="4"/>14 </field>
15 <field name="functional_block_id" select="1" required="1" widget="selection"/>15
16 <field name="categ_id" widget="selection" domain="[('object_id.model','=','project.issue')]"/>16 </field>
17 <!--... domain="[('object_id.model', '=', 'project.issue'),('parent_id','!=',None)]" -->17 </record>
18 <field name="create_uid" readonly="1"/>
19 </field>
20 <field name="project_id" position="attributes">
21 <attribute name="colspan">4</attribute>
22 </field>
23
24 <field name="version_id" position="attributes">
25 <attribute name="groups">base.group_extended</attribute>
26 </field>
27
28 <!-- Partner Address: add domain -->
29 <field name="partner_id" position="replace">
30 <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from, project_id)" required="1"/>
31 </field>
32 <field name="partner_address_id" position="replace">
33 <field name="partner_address_id" string="Address" required="1"
34 on_change="onchange_partner_address_id(partner_address_id, email_from)"
35 domain="[('partner_id','=',partner_id)]"/>
36 </field>
37 <field name="priority" position="after">
38 <field name="section_id" string="Service Team" groups="base.group_extended"/>
39 </field>
40
41 <!-- Create task Button -->
42 <field name="task_id" position="attributes">
43 <attribute name="string">Current Task</attribute>
44 </field>
45 <xpath expr='//button[@name="convert_issue_task"]' position="replace">
46 <button name="convert_issue_task" string="Create Task" icon="gtk-index" type="object" attrs="{'invisible':['|',('task_id','!=',False), ('state','in',['cancel','done'])]}"/>
47 </xpath>
48
49 <!-- Modify existing buttons -->
50 <button name="case_cancel" position="attributes">
51 <attribute name="states">draft,open</attribute>
52 <!--attribute name="type">workflow</attribute-->
53 </button>
54 <button name="case_open" position="attributes">
55 <attribute name="states">draft,pending</attribute>
56 <!--attribute name="type">workflow</attribute-->
57 </button>
58 <button name="case_pending" position="attributes">
59 <attribute name="states">open</attribute>
60 <!--attribute name="type">workflow</attribute-->
61 </button>
62 <button name="case_close" position="attributes">
63 <attribute name="states">open</attribute>
64 <!--attribute name="type">workflow</attribute-->
65 </button>
66 <!-- button name="case_reset" position="replace"/> -->
67
68 <xpath expr='//page[@string="Communication &amp; History"]' position="attributes">
69 <attribute name="groups"/>
70 </xpath>
71 <!-- ###BUG https://bugs.launchpad.net/openobject-addons/+bug/944879 -->
72 <field name="email_cc" position="attributes">
73 <attribute name="widget">email</attribute>
74 </field>
75
76 <!-- Task History tab-->
77 <xpath expr='//page[@string="Extra Info"]' position="before">
78 <page string="Task History">
79 <field name="tasks" nolabel="1" readonly="1"/>
80 </page>
81 </xpath>
82
83 </field>
84 </record>
85
86 <!--PROJECT ISSUE SEARCH -->
87 <record id="view_project_issue_filter_dreis" model="ir.ui.view">
88 <field name="name">Project Issue Tracker Search</field>
89 <field name="model">project.issue</field>
90 <field name="inherit_id" ref="project_issue.view_project_issue_filter"/>
91 <field name="arch" type="xml">
92
93 <!-- "To-Do" button relabeled to "In Progress" -->
94 <filter name="todo" position="attributes">
95 <attribute name="string">Open</attribute>
96 </filter>
97 <!-- name filter -->
98 <field name="name" position="replace">
99 <field name="name" string="Issue" colspan="2"
100 filter_domain="['|','|','|',('project_id','ilike',self), ('partner_id','ilike',self), ('email_from','ilike',self), ('name','ilike',self)]"
101 />
102 </field>
103 <!-- user_id buttons with same order as Tasks (BUGFIX to report) -->
104 <field name="user_id" position="replace">
105 <field name="user_id" filter_domain="['|',('user_id','=',self),('create_uid','=',self)]" string="User">
106 <filter domain="['|',('user_id','=',uid),('create_uid','=',uid)]" help="My Issues" icon="terp-personal" />
107 <filter domain="[('user_id','=',False)]" help="Unassigned Issues" icon="terp-personal-" groups="project.group_project_manager"/>
108 </field>
109 </field>
110 <field name="project_id" position="replace"/>
111
112 <!-- Search by "ref" instead of "id"; add section_id (Team) -->
113 <field name="id" position="replace">
114 <field name="section_id" string="Team" widget="selection" groups="base.group_extended"/>
115 </field>
116 <!-- GROUP BY -->
117 <filter string="Partner" position="after">
118 <filter string="Team" icon="STOCK_SELECT_COLOR" domain="[]" context="{'group_by':'section_id'}"/>
119 </filter>
120 </field>
121 </record>
122
123 <!--PROJECT ISSUE TREE -->
124 <record model="ir.ui.view" id="project_issue_tree_view_reis">
125 <field name="name">Project Issue Tracker Tree</field>
126 <field name="model">project.issue</field>
127 <field name="inherit_id" ref="project_issue.project_issue_tree_view"/>
128 <field name="arch" type="xml">
129 <data>
130 <!-- Colors like Task Tree -->
131 <!-- TODO: red for surpassed dealines -->
132 <tree position="attributes">
133 <attribute name="colors">grey:state in ('cancel','done');blue:state == 'pending'</attribute>
134 </tree>
135 <!-- Internal ID, Version and Stage visible only in Extended mode -->
136 <field name="id" position="attributes"><attribute name="invisible">1</attribute></field>
137 <field name="type_id" position="attributes"><attribute name="groups">base.group_extended</attribute></field>
138 <button name="prev_type" position="attributes"><attribute name="groups">base.group_extended</attribute></button>
139 <button name="next_type" position="attributes"><attribute name="groups">base.group_extended</attribute></button>
140 <field name="version_id" position="attributes"><attribute name="groups">base.group_extended</attribute></field>
141 <field name="categ_id" position="attributes"><attribute name="groups">base.group_extended</attribute></field>
142 <!-- Ref and Category visible after issue name -->
143 <field name="user_id" position="after">
144 <field name="section_id" groups="base.group_extended"/>
145 <field name="create_uid"/>
146 </field>
147 <!-- State buttons equal to Task Tree -->
148 <button name="case_cancel" position="replace"/>
149 <button name="case_close" position="replace"/>
150 <button name="case_pending" position="replace"/>
151 <button name="case_escalate" position="replace"/>
152 <button name="case_reset" position="replace"/>
153 <button name="case_open" position="replace">
154 <button name="convert_issue_task_tree" string="Create Task" icon="gtk-index" type="object"
155 attrs="{'invisible':['|',('task_id','!=',False), ('state','in',['cancel','done'])]}"/>
156 <button name="case_open" string="Open" states="draft,pending" type="object"
157 icon="gtk-media-play" help="Moves to state In Progress" groups="base.group_extended"/>
158 <button name="case_close" string="Done" states="open" type="object"
159 icon="terp-dialog-close"/>
160 </button>
161
162 </data>
163 </field>
164 </record>
165
166 <!-- ISSUE KANBAN VIEW: moving from first to last position-->
167 <record model="ir.actions.act_window.view" id="project_issue.action_crm_tag_kanban_view0">
168 <field name="sequence" eval="10"/>
169 </record>
170 <!-- -->
17118
172 </data>19 </data>
173</openerp>20</openerp>
174
17521
=== modified file 'project_issue_task/project_task.py' (properties changed: +x to -x)
--- project_issue_service/project_task.py 2012-11-22 13:29:38 +0000
+++ project_issue_task/project_task.py 2014-02-25 12:39:41 +0000
@@ -1,7 +1,7 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3# 3#
4# Copyright (C) 2012 Daniel Reis4# Copyright (C) 2012 - 2013 Daniel Reis
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as7# it under the terms of the GNU Affero General Public License as
@@ -18,74 +18,37 @@
18#18#
19##############################################################################19##############################################################################
2020
21from crm import crm21from openerp.osv import fields, orm
22from osv import fields, osv22
23from datetime import datetime, timedelta23
2424class task(orm.Model):
25###TASK_TYPE_USE_GROUPS = [('resolution', 'Resolution Stage'), ('cause', 'Problem Cause')]
26
27#class project_task_type(osv.osv):
28# _inherit = 'project.task.type'
29# _sort = 'use_group, sequence'
30# _columns = {
31# 'use_group': fields.selection( TASK_TYPE_USE_GROUPS , 'Usage', size=16),
32# 'code': fields.char('Code', size=10),
33# }
34#project_task_type()
35
36
37#class project_functional_block(osv.osv):
38# _inherit = 'project.functional_block'
39# _columns = {
40# 'code': fields.char('Code', size=10),
41# }
42#project_functional_block()
43
44class task(osv.osv):
45 _inherit = "project.task"25 _inherit = "project.task"
26
27 def _fld_issue_id(self, cr, uid, ids, field, arg, context=None):
28 res = {}
29 issue_model = self.pool.get('project.issue')
30 for doc in self.browse(cr, uid, ids, context=context):
31 issue_id = issue_model.search(
32 cr, uid, [('task_id', '=', doc.id)], context=context)
33 if issue_id:
34 res[doc.id] = issue_id[0]
35 else:
36 res[doc.id] = None
37 return res
38
46 _columns = {39 _columns = {
47 #modified fields:40 'issue_id': fields.function(
48 'section_id': fields.many2one('crm.case.section', 'Service Team', select=True,\41 _fld_issue_id, string="Related Issue",
49 help='Service team to which Task belongs to.'), #standard: relabeled42 type="many2one", relation="project.issue", store=True),
50 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), #Standard is 0-4; changed to conform with project_issue (1-5)!43 'ref': fields.char('Reference', 20),
51 #added fields:44 'reason_id': fields.many2one('project.task.cause', 'Problem Cause'),
52 'issue_id': fields.many2one('project.issue', 'Related Issue', readonly=True, 45 }
53 help="Issue related to this task"),46
54 'categ_id': fields.related('issue_id', 'categ_id', string='Issue Category', type="many2one", relation='crm.case.categ', store=True),47 def action_close(self, cr, uid, ids, context=None):
55 }48 """ On Task Close, also close Issue """
56 49 issue_ids = [x.issue_id.id
57 def do_close(self, cr, uid, ids, context=None):50 for x in self.browse(cr, uid, ids, context=context)
58 """51 if x.issue_id]
59 Clean up related Issues's 'Current Task', and set issue state to either52 self.pool.get('project.issue').case_close(
60 'done' or 'pending', if pending work is described in the 'todo_desc' field.53 cr, uid, issue_ids, context=context)
61 """54 return super(task, self).action_close(cr, uid, ids, context=context)
62 #Tasks must be closed first, because Issues with active tasks can't be closed
63 res = super(task, self).do_close(cr, uid, ids, context)
64 #Update related issue state
65 issue_model = self.pool.get('project.issue')
66 for tsk in self.browse(cr, uid, ids):
67 if tsk.issue_id and tsk.issue_id.state not in ['done', 'cancel']:
68 #Current task cleaned up, so that the "Create Task" button is shown again
69 issue_model.write(cr, uid, [tsk.issue_id.id], {'task_id': None}, context=context)
70 #If pending work, issue is not closed, but set to "PENDING"
71 if tsk.todo_desc:
72 issue_model.case_pending(cr, uid, [tsk.issue_id.id])
73 else:
74 issue_model.case_close(cr, uid, [tsk.issue_id.id])
75 return res
76
77 def do_cancel(self, cr, uid, ids, context=None):
78 """
79 Clean up related Issues's 'Current Task'
80 """
81 issue_model = self.pool.get('project.issue')
82 for tsk in self.browse(cr, uid, ids):
83 if tsk.issue_id and tsk.issue_id.state not in ['closed', 'cancelled']:
84 issue_model.write(cr, uid, [tsk.issue_id.id], {'task_id': None}, context=context)
85 return super(task, self).do_cancel(cr, uid, ids, context)
86
87task()
88
89# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
90
91
9255
=== renamed file 'project_task_service/project_task_cause.py' => 'project_issue_task/project_task_cause.py' (properties changed: +x to -x)
--- project_task_service/project_task_cause.py 2012-11-22 13:29:38 +0000
+++ project_issue_task/project_task_cause.py 2014-02-25 12:39:41 +0000
@@ -1,6 +1,6 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3# 3#
4# Copyright (C) 2012 Daniel Reis4# Copyright (C) 2012 Daniel Reis
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
@@ -18,11 +18,12 @@
18#18#
19##############################################################################19##############################################################################
2020
21from osv import fields, osv21from openerp.osv import fields, orm
2222
23class project_task_cause(osv.osv):23
24class project_task_cause(orm.Model):
24 _name = 'project.task.cause'25 _name = 'project.task.cause'
25 _description = 'Incident Cause'26 _description = 'Issue Cause'
26 _order = 'sequence'27 _order = 'sequence'
27 _columns = {28 _columns = {
28 'name': fields.char('Cause', required=True, size=64, translate=True),29 'name': fields.char('Cause', required=True, size=64, translate=True),
@@ -33,8 +34,3 @@
33 _defaults = {34 _defaults = {
34 'sequence': 1035 'sequence': 10
35 }36 }
36project_task_cause()
37
38# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
39
40
4137
=== renamed file 'project_task_service/project_task_cause_view.xml' => 'project_issue_task/project_task_cause_view.xml' (properties changed: +x to -x)
--- project_task_service/project_task_cause_view.xml 2012-11-22 14:24:56 +0000
+++ project_issue_task/project_task_cause_view.xml 2014-02-25 12:39:41 +0000
@@ -6,39 +6,48 @@
6 <record id="task_cause_edit" model="ir.ui.view">6 <record id="task_cause_edit" model="ir.ui.view">
7 <field name="name">project.task.cause.form</field>7 <field name="name">project.task.cause.form</field>
8 <field name="model">project.task.cause</field>8 <field name="model">project.task.cause</field>
9 <field name="type">form</field>
10 <field name="arch" type="xml">9 <field name="arch" type="xml">
11 <form string="Task Incident Causes">10
11 <form string="Task Issue Causes">
12 <group>
13 <group>
12 <field name="name"/>14 <field name="name"/>
15 <field name="description"/>
16 </group>
17 <group>
13 <field name="sequence"/>18 <field name="sequence"/>
14 <field name="code"/>19 <field name="code"/>
15 <separator string="Description" colspan="4"/>20 </group>
16 <field colspan="4" name="description" nolabel="1"/>21 </group>
17 </form>22 </form>
23
18 </field>24 </field>
19 </record>25 </record>
2026
21 <record id="task_cause_tree" model="ir.ui.view">27 <record id="task_cause_tree" model="ir.ui.view">
22 <field name="name">project.task.cause.tree</field>28 <field name="name">project.task.cause.tree</field>
23 <field name="model">project.cause.type</field>29 <field name="model">project.task.cause</field>
24 <field name="type">tree</field>
25 <field name="arch" type="xml">30 <field name="arch" type="xml">
26 <tree string="Task Incident Causes">31
32 <tree string="Task Issue Causes">
27 <field name="sequence"/>33 <field name="sequence"/>
28 <field name="code"/>34 <field name="code"/>
29 <field name="name"/>35 <field name="name"/>
30 </tree>36 </tree>
37
31 </field>38 </field>
32 </record>39 </record>
3340
34 <record id="open_task_cause_form" model="ir.actions.act_window">41 <record id="open_task_cause_form" model="ir.actions.act_window">
35 <field name="name">Causes</field>42 <field name="name">Task Issue Causes</field>
36 <field name="res_model">project.task.cause</field>43 <field name="res_model">project.task.cause</field>
37 <field name="view_type">form</field>44 <field name="view_type">form</field>
38 <field name="view_id" ref="task_cause_tree"/>45 <field name="view_id" ref="task_cause_tree"/>
39 </record>46 </record>
4047
41 <menuitem action="open_task_cause_form" id="menu_task_cause_view" parent="project.menu_project_config_project" sequence="3"/>48 <menuitem action="open_task_cause_form"
49 id="menu_task_cause_view"
50 parent="base.menu_definitions"/>
4251
43 </data>52 </data>
44</openerp>53</openerp>
4554
=== modified file 'project_issue_task/project_task_view.xml' (properties changed: +x to -x)
--- project_issue_service/project_task_view.xml 2012-11-22 14:24:56 +0000
+++ project_issue_task/project_task_view.xml 2014-02-25 12:39:41 +0000
@@ -2,50 +2,25 @@
2<openerp>2<openerp>
3 <data>3 <data>
44
5 <!--PROJECT TASK CATEGORIES -->5 <record id="view_project_task_form_issue" model="ir.ui.view">
6 <record id="project_task_categ_action" model="ir.actions.act_window">6 <field name="name">project.task.form.issue</field>
7 <field name="name">Task Categories</field>
8 <field name="res_model">crm.case.categ</field>
9 <field name="view_type">form</field>
10 <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
11 <field name="domain">[('object_id.model', '=', 'project.task')]</field>
12 <field name="context" eval="{'object_id': ref('project.model_project_task')}"/>
13 </record>
14 <menuitem action="project_task_categ_action" name="Categories" id="menu_project_task_category_act" parent="project.menu_project_config_project" />
15
16
17 <!-- TASK FORM -->
18 <record id="view_project_task_form_dreis" model="ir.ui.view">
19 <field name="name">project.task.form.dreis</field>
20 <field name="model">project.task</field>7 <field name="model">project.task</field>
21 <field name="inherit_id" ref="project.view_task_form2"/>8 <field name="inherit_id" ref="project.view_task_form2"/>
22 <field name="arch" type="xml">9 <field name="arch" type="xml">
23 <field name="progress" position="after">10
11 <field name="date_deadline" position="before">
12 <field name="ref"/>
13 </field>
14 <field name="partner_id" position="after">
24 <field name="issue_id"/>15 <field name="issue_id"/>
25 <field name="categ_id" widget="selection" 16 </field>
26 domain="['|',('object_id.model', '=', 'project.task'),('object_id.model', '=', 'project.issue'),('parent_id','!=',None)]"/>17 <field name="description" position="before">
27 </field>18 <group>
28 <field name="partner_id" position="after">19 <field name="reason_id"
29 <field name="section_id"/>20 attrs="{'invisible': [('issue_id','=',False)]}"/>
30 </field>21 </group>
31 <field name="description" position="attributes">22 </field>
32 <attribute name="attrs">{'readonly':[('state','!=','draft')]}</attribute>
33 </field>
34 </field>
35 </record>
3623
37 <!-- TASK TREE -->
38 <record id="view_task_tree2" model="ir.ui.view">
39 <field name="name">project.task.tree</field>
40 <field name="model">project.task</field>
41 <field name="inherit_id" ref="project.view_task_tree2"/>
42 <field name="arch" type="xml">
43
44 <field name="user_id" position="after">
45 <field name="date_start"/>
46 <field name="date_end"/>
47 </field>
48
49 </field>24 </field>
50 </record>25 </record>
5126
5227
=== renamed directory 'project_task_service/security' => 'project_issue_task/security'
=== modified file 'project_issue_task/security/ir.model.access.csv' (properties changed: +x to -x)
--- project_task_service/security/ir.model.access.csv 2012-11-22 13:29:38 +0000
+++ project_issue_task/security/ir.model.access.csv 2014-02-25 12:39:41 +0000
@@ -1,3 +1,3 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_project_task_cause_project_manager","project_task_cause_project_manager","model_project_task_cause","project.group_project_manager",1,1,1,12"access_project_task_cause_project_manager","project_task_cause_project_manager","model_project_task_cause","project.group_project_manager",1,1,1,1
3"access_project_task_cause_project_user","project_task_cause_project_user","model_project_task_cause","project.group_project_user",1,0,0,03"access_project_task_cause_project_user","project_task_cause_project_user","model_project_task_cause","base.group_user",1,0,0,0
44
=== added file 'project_issue_task/security/project_security.xml'
--- project_issue_task/security/project_security.xml 1970-01-01 00:00:00 +0000
+++ project_issue_task/security/project_security.xml 2014-02-25 12:39:41 +0000
@@ -0,0 +1,30 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data noupdate="1">
4
5
6 <record model="ir.rule" id="issue_related_task_employee">
7 <field name="name">Project/Task: Employees can view Issue's related Task</field>
8 <field name="model_id" ref="project.model_project_task"/>
9 <field name="groups" eval="[(4,ref('base.group_user'))]"/>
10 <field name="domain_force">[('issue_id.message_follower_ids', 'in', [user.partner_id.id])]</field>
11 <field name="perm_read" eval="True"/>
12 <field name="perm_create" eval="False"/>
13 <field name="perm_write" eval="False"/>
14 <field name="perm_unlink" eval="False"/>
15 </record>
16
17 <record model="ir.rule" id="issue_related_task_project_user">
18 <field name="name">Project/Task: Project Users can edit Issue's related Task</field>
19 <field name="model_id" ref="project.model_project_task"/>
20 <field name="groups" eval="[(4,ref('project.group_project_user'))]"/>
21 <field name="domain_force">[('issue_id.message_follower_ids', 'in', [user.partner_id.id])]</field>
22 <field name="perm_read" eval="True"/>
23 <field name="perm_create" eval="True"/>
24 <field name="perm_write" eval="True"/>
25 <field name="perm_unlink" eval="True"/>
26 </record>
27
28
29 </data>
30</openerp>
031
=== removed directory 'project_task_service'
=== removed file 'project_task_service/__init__.py'
--- project_task_service/__init__.py 2012-11-22 13:29:38 +0000
+++ project_task_service/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1# -*- coding: utf-8 -*-
2import project_task_cause
3import project_task
4# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
50
=== removed file 'project_task_service/__openerp__.py'
--- project_task_service/__openerp__.py 2013-03-04 16:16:31 +0000
+++ project_task_service/__openerp__.py 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
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{
22 'name': 'Project Task Record',
23 'version': '1.0',
24 "category": "Project Management",
25 'description': """\
26Add to project tasks all necessary fields to record a service intervention:
27* Time spent
28* Materials used
29* Work done description
30* Work pending description
31* Problem cause identification
32
33Before creating new Projects, review the following configurations::
34* Stages: the task stages ""common to all projects" are assigned to new projects by default.
35* Causes: the possible reasons for problem causing a service incidents.
36* Functional Blocks: the sub-components or sub-systems for projects.
37
38Contributions are appreciated. Some ideas to develop:
39* add a 'crm_category_stages' module, to make configurable the stages (type_ids) valid for each Category.
40""",
41 'author': 'Daniel Reis',
42 'website': 'daniel.reis@securitas.pt',
43 'depends': ['project', 'project_functional_blocks', 'project_department'],
44 'update_xml': [
45 'project_task_cause_view.xml',
46 'project_task_view.xml',
47 'security/ir.model.access.csv',
48 ],
49 'installable': False,
50 'application': False,
51}
52# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
530
=== removed file 'project_task_service/project_task.py'
--- project_task_service/project_task.py 2012-11-22 13:29:38 +0000
+++ project_task_service/project_task.py 1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
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 osv import fields, osv
22from datetime import datetime, timedelta
23
24class task(osv.osv):
25 #FUTURE: use task recurrency, to generate maintenance plans
26 #FUTURE: Apply maintenance plan templates (use Project templates?)
27 _inherit = "project.task"
28 _columns = {
29 #modified fields:
30 'functional_block_id': fields.many2one('project.functional_block', 'Component',
31 help = "Component (system, module, function) to be addressed"),
32 #added fields:
33 'ref': fields.char('Code', 20, help="Service Order number"),
34 'report_desc': fields.text('Work description'),
35 'todo_desc': fields.text('Pending issues description'),
36 'reason_id': fields.many2one('project.task.cause', 'Problem Cause', \
37 help='Cause for the incident that made this task necessary. Available list depends on the Task Type.'),
38 }
39
40 def do_close(self, cr, uid, ids, context=None):
41 #Automatically adjust Task Start and End dates based on Work details:
42 for t in self.browse(cr, uid, ids, context=context):
43 task_dts = t.date_start
44 task_dte = t.date_end or t.date_start
45 for w in t.work_ids:
46 #Task start date should not be later than the oldest work line
47 work_dts = w.date
48 task_dts = min(task_dts, work_dts) or work_dts
49 #Task end date should not be before the last work line
50 d = datetime.strptime(w.date, '%Y-%m-%d %H:%M:%S') \
51 + timedelta(seconds=round(w.hours*3600) )
52 work_dte = d.strftime('%Y-%m-%d %H:%M:%S')
53 task_dte = max(task_dte, work_dte) or work_dte
54 vals = {'date_start': task_dts, 'date_end': task_dte}
55 self.write(cr, uid, [t.id],vals, context=context)
56 return super(task, self).do_close(cr, uid, ids, context)
57
58task()
59
60
61class project_work(osv.osv):
62 #Changed Task work default Date to Y-m-d
63 _inherit = "project.task.work"
64 _defaults = {
65 'date': lambda *a: datetime.now().strftime('%Y-%m-%d'),
66 }
67project_work()
68
69
70class project_task_type(osv.osv):
71 _inherit = 'project.task.type'
72 _columns = {
73 'code': fields.char('Code', size=10),
74 }
75project_task_type()
76
77
78class project_functional_block(osv.osv):
79 _inherit = 'project.functional_block'
80 _columns = {
81 'code': fields.char('Code', size=10),
82 }
83project_functional_block()
84
85
86# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
87
88
890
=== removed file 'project_task_service/project_task_view.xml'
--- project_task_service/project_task_view.xml 2012-11-22 13:29:38 +0000
+++ project_task_service/project_task_view.xml 1970-01-01 00:00:00 +0000
@@ -1,152 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!-- Task type CODE -->
6 <record id="task_type_edit_dreis" model="ir.ui.view">
7 <field name="name">project.task.type.form.dreis</field>
8 <field name="model">project.task.type</field>
9 <field name="inherit_id" ref="project.task_type_edit"/>
10 <field name="arch" type="xml">
11 <field name="sequence" position="after">
12 <field name="code"/>
13 </field>
14 </field>
15 </record>
16
17 <!-- Task FORM -->
18 <record id="view_project_task_form_dreis" model="ir.ui.view">
19 <field name="name">project.task.form.dreis</field>
20 <field name="model">project.task</field>
21 <field name="inherit_id" ref="project.view_task_form2"/>
22 <field name="arch" type="xml">
23 <field name="progress" position="after">
24 <field name="ref" string="Service Order Id"/>
25 </field>
26 <!-- State allowed transitions:
27 draft -> open, cancel
28 open -> draft, pending, close
29 pending -> open
30 close -> draft ("reset"
31 -->
32 <button name="do_cancel" position="attributes">
33 <attribute name="states">draft, open</attribute>
34 </button>
35 <button name="do_draft" position="attributes">
36 <attribute name="states">close,cancel</attribute>
37 </button>
38 <button name="do_pending" position="attributes">
39 <attribute name="states">open</attribute>
40 </button>
41 <button name="do_open" position="attributes">
42 <attribute name="states">draft,pending</attribute>
43 </button>
44 <button name="action_close" position="attributes">
45 <attribute name="states">open</attribute>
46 </button>
47
48 <field name="type_id" position="replace"/>
49 <button name="prev_type" position="replace"/>
50 <button name="next_type" position="replace"/>
51
52 <field name="work_ids" position="replace">
53 <!-- Task Time spent -->
54 <field colspan="4" name="work_ids" nolabel="1"
55 attrs="{'readonly':[('state','in',['done','draft'])]}">
56 <tree string="Task Work" editable="top">
57 <field name="date" string="Start Datetime"/>
58 <field name="hours" widget="float_time" sum="Spent Hours" string="Spent Hours (hh:mm)"/>
59 <field name="user_id"/>
60 <field name="name" string="Comments"/>
61 </tree>
62 </field>
63 <!-- Task Work Description -->
64 <group col="4" colspan="4" attrs="{'invisible':[('state','in',['draft','cancel'])]}">
65 <separator string="Work Description" colspan="4"/>
66 <field name="report_desc" nolabel="1" colspan="4"/>
67 <field name="reason_id" widget="selection"/>
68 <group col="4" colspan="2">
69 <field name="type_id" widget="selection" domain="[('code','!=',None)]"/>
70 <button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
71 <button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
72 </group>
73 <label string="Issues to be adressed" colspan="4"/>
74 <field name="todo_desc" nolabel="1" colspan="4"/>
75 </group>
76 </field>
77 </field>
78 </record>
79
80 <!-- TASK TREE -->
81 <record id="view_project_task_tree_dreis" model="ir.ui.view">
82 <field name="name">project.task.tree.dreis</field>
83 <field name="model">project.task</field>
84 <field name="inherit_id" ref="project.view_task_tree2"/>
85 <field name="arch" type="xml">
86 <!-- States: OPEN:draft,pending; CLOSE:open,pending -->
87 <button name="do_open" position="attributes">
88 <attribute name="states">draft,pending</attribute>
89 </button>
90 <button name="action_close" position="attributes">
91 <attribute name="states">open</attribute>
92 </button>
93 </field>
94 </record>
95
96 <!-- TASK SEARCH -->
97 <record id="view_project_task_search_dreis" model="ir.ui.view">
98 <field name="name">project.task.search.dreis</field>
99 <field name="model">project.task</field>
100 <field name="inherit_id" ref="project.view_task_search_form"/>
101 <field name="arch" type="xml">
102 <field name="project_id" position="replace">
103 <field name="project_id"
104 filter_domain="['|','|', ('project_id','ilike',self), ('partner_id','ilike',self), ('name','ilike',self)]"/>
105 </field>
106 </field>
107 </record>
108
109 <!--Task Calendar: project_id before name, uses date_start, not date_deadline-->
110 <record id="view_task_calendar_reis1" model="ir.ui.view">
111 <field name="name">project.task.calendar.reis</field>
112 <field name="model">project.task</field>
113 <field name="type">calendar</field>
114 <field eval="1" name="priority"/>
115 <field name="arch" type="xml">
116 <calendar color="user_id" date_start="date_start" date_delay="planned_hours" string="Tasks">
117 <field name="project_id"/>
118 <field name="name"/>
119 </calendar>
120 </field>
121 </record>
122
123 <!-- TASK MENU ACTION:
124 * No filter buttons activated by default
125 * User's "Department_id" selected by default
126 * Kanban view sequence moved to last
127 -->
128 <record id="project.action_view_task" model="ir.actions.act_window">
129 <field name="name">Tasks</field>
130 <field name="res_model">project.task</field>
131 <field name="view_type">form</field>
132 <field name="view_mode">tree,form,calendar,gantt,graph,kanban</field>
133 <field eval="False" name="filter"/>
134 <field name="view_id" eval="False"/>
135 <field name="context">{"search_default_project_id": project_id, "search_default_department_id": department_id}</field>
136 <field name="search_view_id" ref="project.view_task_search_form"/>
137 <field name="help">A task represents a work that has to be done. Each user works in his own list of tasks where he can record his task work in hours. He can work and close the task itself or delegate it to another user. If you delegate a task to another user, you get a new task in pending state, which will be reopened when you have to review the work achieved. If you install the project_timesheet module, task work can be invoiced based on the project configuration. With the project_mrp module, sales orders can create tasks automatically when they are confirmed.</field>
138 </record>
139 <record id="project.open_view_task_list_kanban" model="ir.actions.act_window.view">
140 <field name="sequence" eval="10"/>
141 </record>
142
143 <!--### REPORT
144 <report auto="False" id="project_task_webkitreport"
145 model="project.task"
146 name="project_task_webkitreport"
147 file="project_service/report/report_project_task.mako"
148 string="Print Task Report" report_type="webkit" />
149 -->
150
151 </data>
152</openerp>
1530
=== removed directory 'project_task_service/static'
=== removed directory 'project_task_service/static/src'
=== removed directory 'project_task_service/static/src/img'
=== removed file 'project_task_service/static/src/img/icon.png'
154Binary files project_task_service/static/src/img/icon.png 2012-11-22 13:29:38 +0000 and project_task_service/static/src/img/icon.png 1970-01-01 00:00:00 +0000 differ1Binary files project_task_service/static/src/img/icon.png 2012-11-22 13:29:38 +0000 and project_task_service/static/src/img/icon.png 1970-01-01 00:00:00 +0000 differ

Subscribers

People subscribed via source and target branches