project_timesheet: impossible to edit a task work

Bug #953006 reported by Lorenzo Battistini
94
This bug affects 17 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 1
6.1
Fix Released
Medium
OpenERP Publisher's Warranty Team
Therp Backports (Deprecated)
Status tracked in Addons-6.1
Addons-6.1
Fix Released
Medium
Holger Brunn (Therp)

Bug Description

openobject-addons/6.1 revno 6664
openobject-server/6.1 revno 4099
openerp-web/6.1 revno 2270

 - Install project_timesheet
 - Create a new project and a new task
 - Using web interface, create a new 'task work' for that task and save the task.
 - Edit the task and try to edit the task work, modifying the time spent.

Get

2012-03-12 13:18:38,920 23377 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/home/elbati/workspace/openerp/6.1/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/elbati/workspace/openerp/6.1/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/elbati/workspace/openerp/6.1/server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/elbati/workspace/openerp/6.1/addons/project_timesheet/project_timesheet.py", line 223, in write

  File "/home/elbati/workspace/openerp/6.1/addons/project/project.py", line 1049, in write
    result = super(task,self).write(cr, uid, ids, vals, context=context)
  File "/home/elbati/workspace/openerp/6.1/server/openerp/osv/orm.py", line 3944, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/home/elbati/workspace/openerp/6.1/server/openerp/osv/fields.py", line 575, in set
    obj.write(cr, user, [act[1]], act[2], context=context)
  File "/home/elbati/workspace/openerp/6.1/addons/project_timesheet/project_timesheet.py", line 125, in write
    context = {}
KeyError: 'journal_id'

Tags: maintenance

Related branches

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
Amit Parik (amit-parik)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Lorenzo,

Thanks for reporting!
This issue has been fixed on lp:~openerp-dev/openobject-addons/trunk-bug-953006-amp branch with following revision no and revision ID.

rev no : 6711
rev Id : 6711 <email address hidden>

Thanks again!

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Yves Hoyos (yves-hoyos) wrote :

The correction you commited is incorrect !
Line 19 of the patch should not be:
  result = self.get_user_related_details(cr, uid, vals.get('user_id', uid))
but
  result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id))

Otherwise, once you edit the line of some one else, the product_id, journal_id, ... is computed on your uid and not on the user_id of the employee who made the task work.

Thanks for changing this in you correction...

Changed in openobject-addons:
status: Fix Committed → Incomplete
Revision history for this message
Lorenzo Battistini (elbati) wrote :

So, better if we set the status to 'in progress'. See http://blog.launchpad.net/general/of-bugs-and-statuses

Changed in openobject-addons:
status: Incomplete → In Progress
Revision history for this message
Yves Hoyos (yves-hoyos) wrote :

Sorry about this. I will know it for next time.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Yves,

Thanks for that correction.

I am totally agree with you, It's my mistake on commit. On my code I have directly taken the values from uid (means which user is login in to system), So it will create error when my task user is different.

Again thank for the correction on this. I just right now changes on branch and commit it asap.

Thanks a lot..!

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Lorenzo and Yues,

I have done the correction as per the comment#2.

Thank you very much.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Yves Hoyos (yves-hoyos) wrote :

Thanks for the correction

Revision history for this message
Houssine (houssine-bakkali) wrote :

Hi guys,

Thanks for the fix.

This fix hasn't been merged yet. Does there is any plan to merge it?

Thanks.

tags: added: maintenance
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Hi,

I have fixed this issue for stable 6.1 in following branch,
lp:~openerp-dev/openobject-addons/6.1-opw-575493-rha
Revision ID: <email address hidden>
Revision 6831

Thanks for the bug report,
Rifakat Haradwala

Revision history for this message
qdp (OpenERP) (qdp) wrote :

fixed in trunk by revision 6950

thanks
Quentin

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Folks,

This problem is still persist in trunk, And I have checked the code of trunk which indicated that the attached branch's code are not completely merged on trunk. I have seen only one line change instead of the whole patch. So I requested to our core team, please double check this Issue before Fix Released.

Problem Occurred When :
--------------------------------
1. Login with Admin / User
2. Go >> Project >> Task
3. edit the Task and try to edit the task workline, modifying the time spent.
and get error : KeyError: 'journal_id'

Thanks !

Changed in openobject-addons:
status: Fix Released → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Jalpesh Patel(OpenERP) (pja-openerp) wrote :

Hello,
      i have fix bug project_timesheet: impossible to edit a task work.
      revision number:7359.
      https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-953006-pja
Thanks,
pja

Revision history for this message
Anto (abourguignon) wrote :

Hello,

The fix has been released in trunk (revno 7714), alongside with some other improvements. Thanks.

Regards,
Anto.

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Anto (abourguignon) wrote :

PS: due to some LP's whims, I had to duplicate the original PJA's branch: https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-953006-abo

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.