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
=== modified file 'user_story/model/user_story.py'
--- user_story/model/user_story.py 2014-04-10 20:29:24 +0000
+++ user_story/model/user_story.py 2014-04-21 17:23:51 +0000
@@ -39,37 +39,6 @@
39 _description = 'User Story'39 _description = 'User Story'
40 _inherit = ['mail.thread']40 _inherit = ['mail.thread']
4141
42 def _get_tasks(self, cr, uid, ids, field_name, arg, context=None):
43 if context is None:
44 context = {}
45 result = {}
46 task_obj = self.pool.get('project.task')
47 for orderpoint in self.browse(cr, uid, ids, context=context):
48 task_ids = task_obj.search(cr, uid, [
49 ('userstory_id', '=', orderpoint.id)])
50 result[orderpoint.id] = task_ids
51 return result
52
53 def _set_task(self, cr, uid, id, name, value, arg, ctx=None):
54
55 task_ids = self.pool.get('project.task').search(
56 cr, uid, [("userstory_id", '=', id)])
57 task_id = list(set(value[0][2]) - set(task_ids))
58 if task_id:
59 for i in task_id:
60 sql_str = """UPDATE project_task set
61 userstory_id='%s'
62 WHERE id=%s """ % (id, i)
63 cr.execute(sql_str)
64 else:
65 task_id = list(set(task_ids) - set(value[0][2]))
66 for i in task_id:
67 sql_str = """UPDATE project_task set
68 userstory_id=Null
69 WHERE id=%s """ % (i)
70 cr.execute(sql_str)
71 return True
72
73 def write(self, cr, uid, ids, vals, context=None):42 def write(self, cr, uid, ids, vals, context=None):
74 task_obj = self.pool.get('project.task')43 task_obj = self.pool.get('project.task')
75 44
@@ -216,13 +185,11 @@
216 '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."),185 '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."),
217 'sk_id': fields.many2one('sprint.kanban', 'Sprint Kanban'),186 'sk_id': fields.many2one('sprint.kanban', 'Sprint Kanban'),
218 'state': fields.selection(_US_STATE, 'State', readonly=True),187 'state': fields.selection(_US_STATE, 'State', readonly=True),
219 'task_ids': fields.function(_get_tasks, type='many2many',188 'task_ids': fields.one2many(
220 relation="project.task",189 'project.task', 'userstory_id',
221 fnct_inv=_set_task,190 string="Tasks",
222 string="Tasks",191 help=("Draft procurement of the product and location of that"
223 help="""Draft procurement of192 " orderpoint")),
224 the product and location
225 of that orderpoint"""),
226 'categ_ids': fields.many2many('project.category','project_category_user_story_rel','userstory_id','categ_id', string="Tags"),193 'categ_ids': fields.many2many('project.category','project_category_user_story_rel','userstory_id','categ_id', string="Tags"),
227 'implementation': fields.text('Implementation Conclusions', translate=True),194 'implementation': fields.text('Implementation Conclusions', translate=True),
228 }195 }
229196
=== modified file 'user_story/view/userstory_view.xml'
--- user_story/view/userstory_view.xml 2014-03-26 17:42:14 +0000
+++ user_story/view/userstory_view.xml 2014-04-21 17:23:51 +0000
@@ -249,8 +249,6 @@
249 <separator orientation="vertical" />249 <separator orientation="vertical" />
250 <filter name="user_story_sk_id" icon="terp-personal" string="Sprint" context="{'group_by':'sk_id'}" />250 <filter name="user_story_sk_id" icon="terp-personal" string="Sprint" context="{'group_by':'sk_id'}" />
251 <separator orientation="vertical" />251 <separator orientation="vertical" />
252 <filter name="user_story_task_ids" icon="terp-personal" string="Task" context="{'group_by':'task_ids'}" />
253 <separator orientation="vertical" />
254 <filter name="priority_level" icon="terp-personal" string="Priority Level" context="{'group_by':'priority_level'}" />252 <filter name="priority_level" icon="terp-personal" string="Priority Level" context="{'group_by':'priority_level'}" />
255 <separator orientation="vertical" />253 <separator orientation="vertical" />
256 <filter name="state" icon="terp-personal" string="States" context="{'group_by':'state'}" />254 <filter name="state" icon="terp-personal" string="States" context="{'group_by':'state'}" />