hr_timesheet/7.0 rev n°56 generates issues in crm_todo module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HR - Timesheet Management |
New
|
Undecided
|
Unassigned |
Bug Description
OpenERP version 7.0-20131024-232504
hr_timeheet/7.0 revision n°56 (and 57)
When updated hr_timesheet/7.0 modules to latest version, a new issue appeared in crm_todo module :
In Sales ==> Opportunities, open/edit an opportunity. Go to "Tasks" tab and click on "add an item". Fill-in the task and save the opportunity.
The following OpenERP server error pops up :
OpenERP Server Error
Client Traceback (most recent call last):
File "/usr/lib/
response[
File "/usr/lib/
return self._call_kw(req, model, method, args, kwargs)
File "/usr/lib/
return getattr(
File "/usr/lib/
result = self.proxy.
File "/usr/lib/
result = self.session.
File "/usr/lib/
raise xmlrpclib.
Server Traceback (most recent call last):
File "/usr/lib/
return openerp.
File "/usr/lib/
result = ExportService.
File "/usr/lib/
res = fn(db, uid, *params)
File "/usr/lib/
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
File "/usr/lib/
result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
File "/usr/lib/
self.
File "/opt/openerp/
project.
AttributeError: 'NoneType' object has no attribute 'id'
Here is what I can see in /var/log/
2013-10-30 16:57:10,924 5028 INFO Comexans werkzeug: 10.1.101.16 - - [30/Oct/2013 16:57:10] "POST /web/dataset/
2013-10-30 16:57:10,926 5028 INFO Comexans werkzeug: 10.1.101.16 - - [30/Oct/2013 16:57:10] "POST /web/dataset/
2013-10-30 16:57:10,997 5028 INFO Comexans werkzeug: 10.1.101.16 - - [30/Oct/2013 16:57:10] "POST /web/dataset/
2013-10-30 16:57:11,066 5028 ERROR Comexans openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
File "/usr/lib/
result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
File "/usr/lib/
self.
File "/opt/openerp/
project.
AttributeError: 'NoneType' object has no attribute 'id'
2013-10-30 16:57:11,069 5028 ERROR Comexans openerp.netsvc: 'NoneType' object has no attribute 'id'
Traceback (most recent call last):
File "/usr/lib/
result = ExportService.
File "/usr/lib/
res = fn(db, uid, *params)
File "/usr/lib/
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
File "/usr/lib/
result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
File "/usr/lib/
self.
File "/opt/openerp/
project.
AttributeError: 'NoneType' object has no attribute 'id'
2013-10-30 16:57:11,071 5028 INFO Comexans werkzeug: 10.1.101.16 - - [30/Oct/2013 16:57:11] "POST /web/dataset/
If I revert hr_timesheet/7.0 to revision n°55, the bug disappears.
Do you have any idea ?
Thanks for your support.
Hi again,
Following my previous post, I can see that the issue is related to hr_timesheet/ 7.0/timesheet_ task/project_ task.py
Since revision 56 some new lines have been added at line 54 :
def _store_ set_values( self, cr, uid, ids, fields, context=None): store_set_ values( cr, uid, ids, fields, context=context)
project. write({ 'parent_ id': project. parent_ id.id})
# Hack to avoid redefining most of function fields of project.project model
# This is mainly due to the fact that orm _store_set_values use direct access to database.
# So when modifiy aa line the _store_set_values as it uses cursor directly to update tasks
# project triggers on task are not called
res = super(ProjectTask, self)._
for row in self.browse(cr, SUPERUSER_ID, ids, context=context):
project = row.project_id
return res
The crm_todo module (introduces GTD method in CRM) and use project_gtd to achieve this. parent_ id.id is NoneType (it does not exist). So a test to verify that project. parent_ id.id is not NoneType brefore calling project.write shall be performed.
So with this crm_todo module, it is possible to create (GTD) tasks in an opportunity (within the CRM). As it is a task it might inherit of the same methods ans this might be the reason why timesheet_task module is invoked. This task is not related to a prent project but to a CRM opportunity and this might be the reason why we have this bug : project.
I am sorry I do not have any knowledge in Python, so I can not fix it myself... Can somebody fix that ?
Thanks for your help...