Merge lp:~vauxoo/addons-vauxoo/7.0-user_story_fix1-kty into lp:addons-vauxoo/7.0

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1003
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-user_story_fix1-kty
Merge into: lp:addons-vauxoo/7.0
Diff against target: 73 lines (+5/-40)
2 files modified
user_story/model/user_story.py (+5/-38)
user_story/view/userstory_view.xml (+0/-2)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-user_story_fix1-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Gabriela Quilarque Pending
Review via email: mp+216609@code.launchpad.net

Description of the change

[MERGE] fix task_ids field in the user story model and remove unnecessary and unsupported group by filter.

To post a comment you must log in.
Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

LGTM.
I am waiting forthe runbot result.

Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

ready the runnbot is green and the change was approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'user_story/model/user_story.py'
2--- user_story/model/user_story.py 2014-04-10 20:29:24 +0000
3+++ user_story/model/user_story.py 2014-04-21 17:23:51 +0000
4@@ -39,37 +39,6 @@
5 _description = 'User Story'
6 _inherit = ['mail.thread']
7
8- def _get_tasks(self, cr, uid, ids, field_name, arg, context=None):
9- if context is None:
10- context = {}
11- result = {}
12- task_obj = self.pool.get('project.task')
13- for orderpoint in self.browse(cr, uid, ids, context=context):
14- task_ids = task_obj.search(cr, uid, [
15- ('userstory_id', '=', orderpoint.id)])
16- result[orderpoint.id] = task_ids
17- return result
18-
19- def _set_task(self, cr, uid, id, name, value, arg, ctx=None):
20-
21- task_ids = self.pool.get('project.task').search(
22- cr, uid, [("userstory_id", '=', id)])
23- task_id = list(set(value[0][2]) - set(task_ids))
24- if task_id:
25- for i in task_id:
26- sql_str = """UPDATE project_task set
27- userstory_id='%s'
28- WHERE id=%s """ % (id, i)
29- cr.execute(sql_str)
30- else:
31- task_id = list(set(task_ids) - set(value[0][2]))
32- for i in task_id:
33- sql_str = """UPDATE project_task set
34- userstory_id=Null
35- WHERE id=%s """ % (i)
36- cr.execute(sql_str)
37- return True
38-
39 def write(self, cr, uid, ids, vals, context=None):
40 task_obj = self.pool.get('project.task')
41
42@@ -216,13 +185,11 @@
43 'user_execute_id': fields.many2one('res.users', 'Execution Responsible',help="Person responsible for user story takes place, either by delegating work to other human resource or running it by itself. For delegate work should monitor the proper implementation of associated activities."),
44 'sk_id': fields.many2one('sprint.kanban', 'Sprint Kanban'),
45 'state': fields.selection(_US_STATE, 'State', readonly=True),
46- 'task_ids': fields.function(_get_tasks, type='many2many',
47- relation="project.task",
48- fnct_inv=_set_task,
49- string="Tasks",
50- help="""Draft procurement of
51- the product and location
52- of that orderpoint"""),
53+ 'task_ids': fields.one2many(
54+ 'project.task', 'userstory_id',
55+ string="Tasks",
56+ help=("Draft procurement of the product and location of that"
57+ " orderpoint")),
58 'categ_ids': fields.many2many('project.category','project_category_user_story_rel','userstory_id','categ_id', string="Tags"),
59 'implementation': fields.text('Implementation Conclusions', translate=True),
60 }
61
62=== modified file 'user_story/view/userstory_view.xml'
63--- user_story/view/userstory_view.xml 2014-03-26 17:42:14 +0000
64+++ user_story/view/userstory_view.xml 2014-04-21 17:23:51 +0000
65@@ -249,8 +249,6 @@
66 <separator orientation="vertical" />
67 <filter name="user_story_sk_id" icon="terp-personal" string="Sprint" context="{'group_by':'sk_id'}" />
68 <separator orientation="vertical" />
69- <filter name="user_story_task_ids" icon="terp-personal" string="Task" context="{'group_by':'task_ids'}" />
70- <separator orientation="vertical" />
71 <filter name="priority_level" icon="terp-personal" string="Priority Level" context="{'group_by':'priority_level'}" />
72 <separator orientation="vertical" />
73 <filter name="state" icon="terp-personal" string="States" context="{'group_by':'state'}" />