Post by sophiecw »

Hello,

We've recently integrated the bryntum Gantt extension into our odoo database. There seems to be no issue on the dev who integrated it into our database but for other users the following "odoo client error" occurs:

UncaughtPromiseError > vw
Uncaught Promise > Load failed
vw: Load failed
Error: Load failed
at f.onCrudRequestFailure (https://www.realdev.be/bryntum_gantt_enterprise/static/gantt_src/js/chunk-vendors.js?v17.0.2.1.23:64:446903)

Why is this happening? Why does it work for one user but not another?
Thanks in advance

Attachments
Capture d'écran 2024-12-11 083654.png
Capture d'écran 2024-12-11 083654.png (23.54 KiB) Viewed 514 times

Post by nivl »

Hi Sophie,

Thanks for your report.

We need more information in order to determine why this is happening:

  1. Are there any other 3rd party modules installed?
  2. Was Bryntum Gantt installed as-is, or was it modified?
  3. Can you reproduce the error on our demo? --> https://odoo-gantt17.bryntum.com/

Please let me know the answers to the above questions and we'll go from there.

Niels


Post by sophiecw »

Hi Niels,

Yes, we have, in addition to the Bryntum Gantt view, two additionnal views developped by Odoo (see attachments).

The Bryntum Gantt was installed as-is, and this didn't seem to cause any issues for the person who implemented it. All other users have the loading issue.

I can't seem to reproduce the error as it seems to be linked with our data. The Gantt view can be opened in our Odoo db but the projects aren't retreivable in the gantt view (I just get the same error message).

Regards,


Post by nivl »

Hi Sophie,

It looks like you forgot to add the attachments of the additional views.

But this already gives me a way forward for you to see if you can make the Gantt work. Because, at the moment, what I can deduce is that one or both of those other modules might interfere with the Gantt's ability to load at some point.

Please create a fresh instance with Odoo installed and the only other 3rd party module Gantt View Pro, and see if the load error still occurs. The outcome should be that it shouldn't. If this is true, add the other 2 modules one by one and check with each after adding if the load error starts occurring. When it shows up, you know which other module is causing the problem and you can go from there to fix it so everyone can get to the Gantt without errors.

Please let me know if this helps.

Niels


Post by sophiecw »

Hi Niels,

We checked the Gantt view in a new branch without the third party modules and we still have the same issue :
Error:
UncaughtPromiseError > vw
Uncaught Promise > Load failed

Branch: https://realdev-testso-17215376.dev.odoo.com/web#action=1745&model=project.task&view_type=BryntumGantt&cids=1&menu_id=1158

Do you have any ideas ?


Post by nivl »

Hi Sophie,

Thanks for the information, but sadly this didn't help us determine the cause.

Could you, instead, open the developer tools of your web browser, go to Network, load, and then Response. Please send us all the content that is in Response. I've attached a screenshot that shows where you need to be.

Attachments
Network - load - response.png
Network - load - response.png (155.63 KiB) Viewed 321 times

Niels


Post by sophiecw »

Hi,

Gantt-no content.png
Gantt-no content.png (62.42 KiB) Viewed 310 times

It seems to think that there's no content so it doesn't reach the load task

Gantt-no content-failed to load.png
Gantt-no content-failed to load.png (61.04 KiB) Viewed 310 times

Thanks for the help


Post by tomb »

Sophie can you try the following:

  1. In another tab, switch "Activate debug mode with assets" on (in Settings and scroll fully down)
  2. Leave the developer tools open and refresh page one more time with Ctrl-F5, and show again what's being loaded under Fetch/XHR
  3. Also screenshot the console page to see again the error
  4. Try the same but select only one project

According to the error message it does try to load tasks but fails during the process, so the XHR command should be there


Post by sophiecw »

Hi again,

We've figured out that it was due to our mutli-company use of Odoo. As the other users don't have access to the other company's data, the information wouldn't load.
I got the following from the Network/load as you suggested but in our production db:

"jsonrpc": "2.0",
    "id": 351254732720,
    "error": {
        "code": 200,
        "message": "Odoo Server Error",
        "data": {
            "name": "odoo.exceptions.AccessError",
            "debug": "Traceback (most recent call last):\n  File \"/home/odoo/src/odoo/odoo/http.py\", line 1783, in _serve_db\n    return service_model.retrying(self._serve_ir_http, self.env)\n  File \"/home/odoo/src/odoo/odoo/service/model.py\", line 133, in retrying\n    result = func()\n  File \"/home/odoo/src/odoo/odoo/http.py\", line 1810, in _serve_ir_http\n    response = self.dispatcher.dispatch(rule.endpoint, args)\n  File \"/home/odoo/src/odoo/odoo/http.py\", line 2014, in dispatch\n    result = self.request.registry['ir.http']._dispatch(endpoint)\n  File \"/home/odoo/src/odoo/addons/website/models/ir_http.py\", line 235, in _dispatch\n    response = super()._dispatch(endpoint)\n  File \"/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py\", line 221, in _dispatch\n    result = endpoint(**request.params)\n  File \"/home/odoo/src/odoo/odoo/http.py\", line 757, in route_wrapper\n    result = endpoint(self, *args, **params_ok)\n  File \"/home/odoo/src/user/bryntum_gantt_enterprise/controllers/controllers.py\", line 200, in bryntum_gantt_load\n    calendars = all_projects.get_calendars()\n  File \"/home/odoo/src/user/bryntum_gantt_enterprise/models/project_project.py\", line 69, in get_calendars\n    calendars_objs = [\n  File \"/home/odoo/src/user/bryntum_gantt_enterprise/models/project_project.py\", line 90, in <listcomp>\n    \"leave_intervals\": [\n  File \"/home/odoo/src/user/bryntum_gantt_enterprise/models/project_project.py\", line 95, in <listcomp>\n    \"resource_name\": interval.resource_id.name,\n  File \"/home/odoo/src/odoo/odoo/fields.py\", line 1182, in __get__\n    recs._fetch_field(self)\n  File \"/home/odoo/src/odoo/odoo/models.py\", line 3815, in _fetch_field\n    self.fetch(fnames)\n  File \"/home/odoo/src/odoo/odoo/models.py\", line 3871, in fetch\n    raise self.env['ir.rule']._make_access_error('read', forbidden)\nodoo.exceptions.AccessError: Uh-oh! Looks like you have stumbled upon some top-secret records.\n\nSorry, Sophie Christian-Woodruff (id=199) doesn't have 'read' access to:\n- Resources, Antoine David (resource.resource: 138)\n\nBlame the following rules:\n- resource.resource multi-company\n\nNote: this might be a multi-company issue. Switching company may help - in Odoo, not in real life!\n\nIf you really, really need access, perhaps you can win over your friendly administrator with a batch of freshly baked cookies.\n",
            "message": "Uh-oh! Looks like you have stumbled upon some top-secret records.\n\nSorry, Sophie Christian-Woodruff (id=199) doesn't have 'read' access to:\n- Resources, Antoine David (resource.resource: 138)\n\nBlame the following rules:\n- resource.resource multi-company\n\nNote: this might be a multi-company issue. Switching company may help - in Odoo, not in real life!\n\nIf you really, really need access, perhaps you can win over your friendly administrator with a batch of freshly baked cookies.",
            "arguments": [
                "Uh-oh! Looks like you have stumbled upon some top-secret records.\n\nSorry, Sophie Christian-Woodruff (id=199) doesn't have 'read' access to:\n- Resources, Antoine David (resource.resource: 138)\n\nBlame the following rules:\n- resource.resource multi-company\n\nNote: this might be a multi-company issue. Switching company may help - in Odoo, not in real life!\n\nIf you really, really need access, perhaps you can win over your friendly administrator with a batch of freshly baked cookies."
            ],  "context": {}

I was given acess so it now works on my end :)
However, how can we load the project data but limite the access, as we don't want all the users to see the other company's project information.

Thanks


Post by nivl »

Hi Sophie,

Currently, this is not an option. I've created a task for this and we'll look into it. It might take a bit as we have a pretty full kanban of tasks that are ahead in the pipeline. I'll keep you posted.

Niels


Post Reply