Merge lp:~openerp-dev/openobject-addons/6.1-opw-574389-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574389-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 39 lines (+9/-3)
2 files modified
project_mailgate/project_mailgate.py (+4/-0)
project_mrp/project_mrp.py (+5/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574389-ado
Reviewer Review Type Date Requested Status
Amit Dodiya (OpenERP) (community) Needs Resubmitting
Naresh(OpenERP) (community) Needs Fixing
Xavier ALT Pending
Review via email: mp+104672@code.launchpad.net

Description of the change

Hello,

"[FIX] Error on delegate task"

Steps to reproduce:

1). Install project, project_mrp and project_mailgate modules.
2). Create a new task and try to delegate with pending / done state.

Regards,
Amit

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

The line 36 in the diff wf_service.trg_write(uid, 'procurement.order', task.procurement_id.id, cr)

should be wf_service.trg_write(uid, 'procurement.order', task_data.procurement_id.id, cr)

otherwise you will have * undefined variable task *\

Thanks,
Naresh

review: Needs Fixing
Revision history for this message
Amit Dodiya (OpenERP) (ado-openerp) wrote :

Hello,

The code is changed.

Regards,
Amit

review: Needs Resubmitting
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6877. By Amit Dodiya<email address hidden>

[FIX] Error on delegate task

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project_mailgate/project_mailgate.py'
2--- project_mailgate/project_mailgate.py 2011-09-07 22:38:59 +0000
3+++ project_mailgate/project_mailgate.py 2012-07-05 11:37:23 +0000
4@@ -99,12 +99,16 @@
5 def do_pending(self, cr, uid, ids, context=None):
6 res = super(project_tasks, self).do_pending(cr, uid, ids, context)
7 tasks = self.browse(cr, uid, ids, context=context)
8+ if not isinstance(tasks,list):
9+ tasks = [tasks]
10 self.message_append(cr, uid, tasks, _('Pending'), context=context)
11 return res
12
13 def do_close(self, cr, uid, ids, context=None):
14 res = super(project_tasks, self).do_close(cr, uid, ids, context)
15 tasks = self.browse(cr, uid, ids, context=context)
16+ if not isinstance(tasks,list):
17+ tasks = [tasks]
18 for task in tasks:
19 if task.state == 'done':
20 self.message_append(cr, uid, tasks, _('Done'), context=context)
21
22=== modified file 'project_mrp/project_mrp.py'
23--- project_mrp/project_mrp.py 2012-01-02 10:08:34 +0000
24+++ project_mrp/project_mrp.py 2012-07-05 11:37:23 +0000
25@@ -32,9 +32,11 @@
26
27 def _validate_subflows(self, cr, uid, ids):
28 wf_service = netsvc.LocalService("workflow")
29- for task in self.browse(cr, uid, ids):
30- if task.procurement_id:
31- wf_service.trg_write(uid, 'procurement.order', task.procurement_id.id, cr)
32+ task_data = self.browse(cr, uid, ids)
33+ if isinstance(task_data, list):
34+ task_data = task_data[0]
35+ if task_data.procurement_id:
36+ wf_service.trg_write(uid, 'procurement.order', task_data.procurement_id.id, cr)
37
38 def do_close(self, cr, uid, ids, *args, **kwargs):
39 res = super(project_task, self).do_close(cr, uid, ids, *args, **kwargs)