Merge lp:~openerp-dev/openobject-addons/trunk-bug-953006-amp into lp:openobject-addons

Proposed by Amit Parik
Status: Merged
Merged at revision: 6950
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-953006-amp
Merge into: lp:openobject-addons
Diff against target: 25 lines (+4/-4)
1 file modified
project_timesheet/project_timesheet.py (+4/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-953006-amp
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+103274@code.launchpad.net

This proposal supersedes a proposal from 2012-04-03.

Description of the change

Hello,

When edit the task work log entry via web-client keyerror:Journal_id is generated because don't assign the journal value in vals_line dict.

This fix will solve this problem.

I have done a correction on above fix. Above fix was taken a user_id from uid (which user login in to system) but It should be taken from task 's user.

Thanks Yves for the correction!

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'project_timesheet/project_timesheet.py'
--- project_timesheet/project_timesheet.py 2012-01-31 13:36:57 +0000
+++ project_timesheet/project_timesheet.py 2012-04-24 13:06:35 +0000
@@ -142,10 +142,6 @@
142 vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')142 vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')
143 if 'user_id' in vals:143 if 'user_id' in vals:
144 vals_line['user_id'] = vals['user_id']144 vals_line['user_id'] = vals['user_id']
145 result = self.get_user_related_details(cr, uid, vals['user_id'])
146 for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
147 if result.get(fld, False):
148 vals_line[fld] = result[fld]
149 145
150 if 'date' in vals:146 if 'date' in vals:
151 vals_line['date'] = vals['date'][:10]147 vals_line['date'] = vals['date'][:10]
@@ -153,6 +149,10 @@
153 default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id149 default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id
154 vals_line['unit_amount'] = vals['hours']150 vals_line['unit_amount'] = vals['hours']
155 prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set151 prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set
152 result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id))
153 for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
154 if result.get(fld, False):
155 vals_line[fld] = result[fld]
156156
157 if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):157 if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):
158 vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id'])158 vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id'])

Subscribers

People subscribed via source and target branches

to all changes: