Merge lp:~openerp-dev/openobject-addons/trunk-bug-898113-mtr into lp:openobject-addons

Proposed by Meera Trambadia (OpenERP)
Status: Rejected
Rejected by: Harry (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-898113-mtr
Merge into: lp:openobject-addons
Diff against target: 50 lines (+6/-6)
1 file modified
project/project.py (+6/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-898113-mtr
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Needs Fixing
Review via email: mp+84067@code.launchpad.net

Description of the change

project: fixed value error, by returning an id through context['default_project_id'] inplace of converting str to int. i.e int(context['project_id'])" --fixes=lp:898113

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

The orm already handles all fields initialized with 'default_XXX' in context. You may simply remove the default value for project, and delete method _default_project.

Please check sure that the project is never initialized by putting a 'project_id' in context.

Thanks,
Raphael

review: Needs Fixing

Unmerged revisions

5839. By Meera Trambadia (OpenERP)

[FIX] project: fixed value error, by returning an id

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project/project.py'
2--- project/project.py 2011-11-23 13:31:32 +0000
3+++ project/project.py 2011-12-01 07:12:27 +0000
4@@ -360,7 +360,7 @@
5 working_days = %s
6 resource = %s
7 """ % (
8- project.id,
9+ project.id,
10 project.date_start, working_days,
11 '|'.join(['User_'+str(x) for x in puids])
12 )
13@@ -531,8 +531,8 @@
14 def _default_project(self, cr, uid, context=None):
15 if context is None:
16 context = {}
17- if 'project_id' in context and context['project_id']:
18- return int(context['project_id'])
19+ if 'default_project_id' in context and context['default_project_id']:
20+ return context['default_project_id']
21 return False
22
23 def duplicate_task(self, cr, uid, map_ids, context=None):
24@@ -907,7 +907,7 @@
25 self.do_pending(cr, uid, task.id, context=context)
26 elif delegate_data['state'] == 'done':
27 self.do_close(cr, uid, task.id, context=context)
28-
29+
30 message = _("The task '%s' has been delegated to %s.") % (delegate_data['name'], delegate_data['user_id'][1])
31 self.log(cr, uid, task.id, message)
32 delegrated_tasks[task.id] = delegrated_task_id
33@@ -983,7 +983,7 @@
34 new_stage = vals.get('type_id')
35 vals_reset_kstate = dict(vals, kanban_state='normal')
36 for t in self.browse(cr, uid, ids, context=context):
37- write_vals = vals_reset_kstate if t.type_id != new_stage else vals
38+ write_vals = vals_reset_kstate if t.type_id != new_stage else vals
39 super(task,self).write(cr, uid, [t.id], write_vals, context=context)
40 return True
41 return super(task,self).write(cr, uid, ids, vals, context=context)
42@@ -1074,7 +1074,7 @@
43 if vals.get('child_ids', False) and context.get('analytic_project_copy', False):
44 vals['child_ids'] = []
45 return super(account_analytic_account, self).create(cr, uid, vals, context=context)
46-
47+
48 def unlink(self, cr, uid, ids, *args, **kwargs):
49 project_obj = self.pool.get('project.project')
50 analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)])

Subscribers

People subscribed via source and target branches

to all changes: