Merge lp:~openerp-dev/openobject-addons/6.1-bug-972544-vba into lp:openobject-addons/6.1

Proposed by Vijaykumar Baladaniya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-bug-972544-vba
Merge into: lp:openobject-addons/6.1
Diff against target: 21 lines (+8/-3)
1 file modified
project/project.py (+8/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-bug-972544-vba
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+124148@code.launchpad.net

Description of the change

Hello Sir,

    I have improve the code for move a task to a stage that is defined on the project of the task. Kindly review the code.

Thanks,
Vijay Baladaniya

To post a comment you must log in.

Unmerged revisions

6977. By Vijaykumar Baladaniya (OpenERP)

[FIX] Not possible to move a task to a stage that is not defined on the project.

6976. By Vijaykumar Baladaniya (OpenERP)

[FIX] Possible to move a task to a stage that is defined on the project of the task.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'project/project.py'
--- project/project.py 2012-07-20 15:12:03 +0000
+++ project/project.py 2012-09-13 10:05:23 +0000
@@ -1043,9 +1043,14 @@
1043 new_stage = vals.get('type_id')1043 new_stage = vals.get('type_id')
1044 vals_reset_kstate = dict(vals, kanban_state='normal')1044 vals_reset_kstate = dict(vals, kanban_state='normal')
1045 for t in self.browse(cr, uid, ids, context=context):1045 for t in self.browse(cr, uid, ids, context=context):
1046 write_vals = vals_reset_kstate if t.type_id != new_stage else vals 1046 if t.project_id.type_ids:
1047 super(task,self).write(cr, uid, [t.id], write_vals, context=context)1047 stage_id = [ item.id for item in t.project_id.type_ids]
1048 result = True1048 if new_stage in (stage_id):
1049 write_vals = vals_reset_kstate if t.type_id != new_stage else vals
1050 super(task,self).write(cr, uid, [t.id], write_vals, context=context)
1051 result = True
1052 else:
1053 result = False
1049 else:1054 else:
1050 result = super(task,self).write(cr, uid, ids, vals, context=context)1055 result = super(task,self).write(cr, uid, ids, vals, context=context)
1051 if ('type_id' in vals) or ('remaining_hours' in vals) or ('user_id' in vals) or ('state' in vals) or ('kanban_state' in vals):1056 if ('type_id' in vals) or ('remaining_hours' in vals) or ('user_id' in vals) or ('state' in vals) or ('kanban_state' in vals):