Post by thomas_braintec »

Hi Guys, we found out that there is a bug in the combination of "normal" tasks and recurring tasks. If we have both types in a project we are getting an error message by opening the Gantt view in Odoo 14 (enterprise).

This is what we get (see below). Can you have a look at it? If you need more detailed information, please drop me a line!

Thanks, Thomas

Fehler:
Odoo Server Error

Traceback (most recent call last):
File "/home/openerp/repos/odoo/odoo/addons/base/models/ir_http.py", line 237, in dispatch
result = request.dispatch()
File "/home/openerp/repos/odoo/odoo/http.py", line 684, in dispatch
result = self.
call_function(**self.params)
File "/home/openerp/repos/odoo/odoo/http.py", line 360, in call_function
return checked_call(self.db, *args, **kwargs)
File "/home/openerp/repos/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, args, **kwargs)
File "/home/openerp/repos/odoo/odoo/http.py", line 348, in checked_call
result = self.endpoint(
a, **kw)
File "/home/openerp/repos/odoo/odoo/http.py", line 913, in call
return self.method(args, **kw)
File "/home/openerp/repos/odoo/odoo/http.py", line 532, in response_wrap
response = f(
args, **kw)
File "/home/openerp/repos/odoo/addons/web/controllers/main.py", line 1347, in search_read
return self.do_search_read(model, fields, offset, limit, domain, sort)
File "/home/openerp/repos/odoo/addons/web/controllers/main.py", line 1366, in do_search_read
return Model.web_search_read(domain, fields, offset=offset, limit=limit, order=sort)
File "/home/openerp/repos/odoo/addons/web/models/models.py", line 62, in web_search_read
records = self.search_read(domain, fields, offset=offset, limit=limit, order=order)
File "/home/openerp/repos/odoo/odoo/models.py", line 4841, in search_read
result = records.read(fields)
File "/home/openerp/repos/odoo/odoo/models.py", line 3022, in read
return self.
read_format(fnames=fields, load=load)
File "/home/openerp/repos/odoo/odoo/models.py", line 3042, in read_format
vals[name] = convert(record[name], record, use_name_get)
File "/home/openerp/repos/odoo/odoo/models.py", line 5668, in getitem
return self.
fields[key].get(self, type(self))
File "/home/openerp/repos/odoo/odoo/fields.py", line 1019, in get
self.compute_value(recs)
File "/home/openerp/repos/odoo/odoo/fields.py", line 1175, in compute_value
records._compute_field_value(self)
File "/home/openerp/repos/odoo/addons/mail/models/mail_thread.py", line 410, in compute_field_value
return super().
compute_field_value(field)
File "/home/openerp/repos/odoo/odoo/models.py", line 4063, in _compute_field_value
getattr(self, field.compute)()
File "/home/openerp/repos/enterprise/project_enterprise/models/project.py", line 88, in compute_recurrence_message
return super(Task, self).
compute_recurrence_message()
File "/home/openerp/repos/odoo/addons/project/models/project.py", line 774, in compute_recurrence_message
date = self.
get_recurrence_start_date()
File "/home/openerp/repos/enterprise/project_enterprise/models/project.py", line 84, in _get_recurrence_start_date
return self.planned_date_begin or fields.Date.today()
File "/home/openerp/repos/odoo/odoo/fields.py", line 963, in get
record.ensure_one()
File "/home/openerp/repos/odoo/odoo/models.py", line 4993, in ensure_one
raise ValueError("Expected singleton: %s" % self)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/openerp/repos/odoo/odoo/http.py", line 640, in handle_exception
return super(JsonRequest, self).
handle_exception(exception)
File "/home/openerp/repos/odoo/odoo/http.py", line 316, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: Expected singleton: project.task(7952, 7950)


Post by Terence »

Thank you for the report! We are going to find out whats going on and fix it.

https://github.com/bryntum/odoo-support/issues/40


Post by Terence »

I am not able to reproduce it. I added recurring tasks to the project but I do not get any error. What are the steps to reproduce or how should the project look like to crash it? Hope you can give some more info.


Post by thomas_braintec »


Post by Terence »

I think this is a bug in Odoo's project model. I did not notice because my dev environment was a bit outdated

In the project and project_enterprise project model they added the following function

def _get_recurrence_start_date(self):
        return self.planned_date_begin or fields.Date.today()

It crashes on self.planned_date_begin because on created recurrent task this field is missing in the model or has a None value. Not sure.

We will patch this in our model.

I am not able to reproduce the long loading on our demo or dev site. It can be some module you have installed. I am not sure which one.


Post by Terence »

Patched it will ship with the next release 1.2.5


Post by Terence »

Loading performance can be related to this ticket

https://github.com/bryntum/odoo-support/issues/42


Post by thomas_braintec »

Terence wrote: Fri Sep 24, 2021 9:59 am

Patched it will ship with the next release 1.2.5

Thanks, Terence! Can you tell me when this release will come?


Post by Terence »

1.2.5 is already there!

https://apps.odoo.com/apps/modules/14.0/bryntum_gantt_enterprise

The loading issue is most likely caused by the avatar blob returned. That one can be commented in the controller (for now) and will ship upcoming Friday in the release 1.2.6.


Post Reply