Merge lp:~invitu/project-service/7.0-issue_task-dr-synctaskissue into lp:~dreis-pt/project-service/7.0-issue_task-dr

Proposed by invitu
Status: Needs review
Proposed branch: lp:~invitu/project-service/7.0-issue_task-dr-synctaskissue
Merge into: lp:~dreis-pt/project-service/7.0-issue_task-dr
Diff against target: 52 lines (+17/-2)
3 files modified
project_issue_task/project_issue.py (+1/-0)
project_issue_task/project_issue_view.xml (+5/-2)
project_issue_task/project_task.py (+11/-0)
To merge this branch: bzr merge lp:~invitu/project-service/7.0-issue_task-dr-synctaskissue
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp (community) Needs Resubmitting
Daniel Reis Needs Information
Review via email: mp+201051@code.launchpad.net

Description of the change

- add priority field to new created task from issue view (the task priority should reflect issue priority)

- synchronize stage from task to issue (the task stage should fit with the issue stage)

- by the way, stage field in issue view is set to readonly

Regards

To post a comment you must log in.
32. By invitu

[IMP] add priority field to new task + synchronize stage from task to issue

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

Thanks for the PM, just had a good look at it:

With this module, for me the Task is like just an attachment document, so I didn't worry about
syncing data between them. But it doesn't trouble me and I admit there could be advantages to it.
Can you give a use case where you find useful to have the extra care of maintaining some of the Tasks attribs in sync?

For this to work a small but important change should be made:
Or project_issue.write(), also keep the Task's Priority in sync.

Revision history for this message
Daniel Reis (dreis-pt) :
review: Needs Information
Revision history for this message
invitu (invitu) wrote :

Dear Daniel

Thanks for your review. Here is our use case :

We usually use project_task as the main object for users. Everyday, the backoffice users work from the task list.

The issue is managed from our front desk. It manages issues.

That's why we want to sync tasks and issue.

But in case task is not linked to issue, it should work... I think we have more improvement to do...

and you're right, priority has to be synced too

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

It makes sense. I see this as a feature/enhancement, so I invite you to review the main MP, so that we can get it merged ASAP, and then we'll work on this to be merged against the trunk branch.

How I think this should work:
* stage and priority should be editable both on Issue and Task, and synced both ways;
* project_issue.task_id should be read-only, at least for non Project Managers.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

the target branch of this MP has been merged into lp:project-service therefore this MP is moot.

Please resubmit on the correct branch.

review: Needs Resubmitting
Revision history for this message
invitu (invitu) wrote :

ok, I just resubmitted on lp:project-service

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

This project is now hosted on https://github.com/OCA/project-service. Please move your proposal there.
This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Unmerged revisions

32. By invitu

[IMP] add priority field to new task + synchronize stage from task to issue

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project_issue_task/project_issue.py'
2--- project_issue_task/project_issue.py 2013-11-20 15:38:29 +0000
3+++ project_issue_task/project_issue.py 2014-01-09 17:43:59 +0000
4@@ -37,6 +37,7 @@
5 if hasattr(rec, x) and getattr(rec, x)}
6 task_data['name'] = _('Report for %s') % rec.name
7 task_data['issue_id'] = rec.id
8+ task_data['priority'] = rec.priority
9 task_data['categ_ids'] = [(6, 0, [x.id for x in rec.categ_ids])]
10
11 task_model = self.pool.get('project.task')
12
13=== modified file 'project_issue_task/project_issue_view.xml'
14--- project_issue_task/project_issue_view.xml 2013-11-20 15:38:29 +0000
15+++ project_issue_task/project_issue_view.xml 2014-01-09 17:43:59 +0000
16@@ -9,9 +9,12 @@
17 <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
18 <field name="arch" type="xml">
19
20- <field name="task_id" position="after">
21+ <field name="task_id" position="after">
22 <button type="object" name="action_create_task" string="Task Report" attrs="{'invisible': [('task_id', '!=', False)]}"/>
23- </field>
24+ </field>
25+ <xpath expr="//field[@name='stage_id']" position="replace">
26+ <field name="stage_id" widget="statusbar" attrs="{'readonly':True}"/>
27+ </xpath>
28
29 </field>
30 </record>
31
32=== modified file 'project_issue_task/project_task.py'
33--- project_issue_task/project_task.py 2013-12-17 11:41:16 +0000
34+++ project_issue_task/project_task.py 2014-01-09 17:43:59 +0000
35@@ -43,6 +43,17 @@
36 'reason_id': fields.many2one('project.task.cause', 'Problem Cause'),
37 }
38
39+ def write(self, cr, uid, ids, vals, context=None):
40+ if 'stage_id' in vals:
41+ project_issue_obj = self.pool.get('project.issue')
42+ task_obj = self.pool.get('project.task')
43+ for x in task_obj.browse(cr, uid, ids, context=context):
44+ val2 = {'stage_id': vals['stage_id']}
45+ project_issue_obj.write(cr, uid, [x.issue_id.id], val2, context=context)
46+
47+ return super(task, self).write(cr, uid, ids, vals, context=context)
48+
49+
50 def action_close(self, cr, uid, ids, context=None):
51 """ On Task Close, also close Issue """
52 issue_ids = [x.issue_id.id

Subscribers

People subscribed via source and target branches

to all changes: