Amit Parik (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-953006-amp into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #953006 in OpenERP Addons: "project_timesheet: impossible to edit a task
work"
https://bugs.launchpad.net/openobject-addons/+bug/953006
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-953006-amp/+merge/103274
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!
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-953006-amp/+merge/103274
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-953006-amp.
=== 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 @@
vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')
if 'user_id' in vals:
vals_line['user_id'] = vals['user_id']
- result = self.get_user_related_details(cr, uid, vals['user_id'])
- for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
- if result.get(fld, False):
- vals_line[fld] = result[fld]
if 'date' in vals:
vals_line['date'] = vals['date'][:10]
@@ -153,6 +149,10 @@
default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id
vals_line['unit_amount'] = vals['hours']
prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set
+ result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id))
+ for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
+ if result.get(fld, False):
+ vals_line[fld] = result[fld]
if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):
vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id'])
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp