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
1=== modified file 'project_timesheet/project_timesheet.py'
2--- project_timesheet/project_timesheet.py 2012-01-31 13:36:57 +0000
3+++ project_timesheet/project_timesheet.py 2012-04-24 13:06:35 +0000
4@@ -142,10 +142,6 @@
5 vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')
6 if 'user_id' in vals:
7 vals_line['user_id'] = vals['user_id']
8- result = self.get_user_related_details(cr, uid, vals['user_id'])
9- for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
10- if result.get(fld, False):
11- vals_line[fld] = result[fld]
12
13 if 'date' in vals:
14 vals_line['date'] = vals['date'][:10]
15@@ -153,6 +149,10 @@
16 default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id
17 vals_line['unit_amount'] = vals['hours']
18 prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set
19+ result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id))
20+ for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
21+ if result.get(fld, False):
22+ vals_line[fld] = result[fld]
23
24 if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):
25 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: