Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] web: $el in kanban widget is not safe to use #31254

Closed
wants to merge 1 commit into
base: 12.0
from

Conversation

Projects
None yet
3 participants
@Julien00859
Copy link
Contributor

Julien00859 commented Feb 19, 2019

The definition of the $el attribute of the kanban widget can be delayed by a willStart, it occurs when opening Accounting with studio where some js libs need to be downloaded.

The fix consist of creating a temporary empty <div> element that is replaced by the actual element once the willStart deferred resolves.

opw-1925079
opw-1925479

related to #30087

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

[FIX] web: $el in kanban widget is not safe to use
The definition of the $el attribute of the kanban widget can be
delayed by a willStart, it occurs when opening Accounting with
studio where some js libs need to be downloaded.

The fix consist of creating a temporary empty <div> element that
is replaced by the actual element once the willStart deferred
resolves.

opw-1925079
opw-1925479

related to #30087

@Julien00859 Julien00859 requested a review from kebeclibre Feb 19, 2019

@robodoo robodoo added the seen 🙂 label Feb 19, 2019

@Julien00859

This comment has been minimized.

Copy link
Contributor Author

Julien00859 commented Feb 19, 2019

do not merge yet

@robodoo robodoo added the CI 🤖 label Feb 19, 2019

@C3POdoo C3POdoo added the OE label Feb 19, 2019

@Julien00859

This comment has been minimized.

Copy link
Contributor Author

Julien00859 commented Feb 20, 2019

@kebeclibre the deferred is pending because it is loading the nvd3 library, if this fixes the $el, the library is not loaded while going through basic_fields:_renderInDOM (line 2572, v12) and crashes on nv.addGraph becauses the global variable does not exists yet. I'm almost sure there is a missing $.when somewhere but from my perspective it is very hard to find missing lines of codes, any advice ?

@Julien00859

This comment has been minimized.

Copy link
Contributor Author

Julien00859 commented Feb 20, 2019

aab-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 21, 2019

[FIX] web: kanban: rendering of async widgets
This rev. fixes 3 issues with async (field) widgets in the kanban
view.

From rev. 5faec34, widget'$el doesn't exist before start. This
means that for async widgets, one can't interact with the widget's
$el right after calling appentTo. In KanbanRecord, this is exactly
what we did for both field widgets (<field name=.../>) and widgets
(<widget name=.../>).

Moreover, when the kanban view was updated (e.g. when the user
refined the search using the search view), and the rendering was
async (because of the presence of an async widget), the renderer
didn't wait at all for the widget to be ready before updating the
view. This caused flickering, mostly, but also a crash in
accounting with the JournalDashboardGraph widget (because
on_attach_callabck was called before the widget was ready). To
reproduce this particular issue, go to accounting, add a filter
that doesn't match any record and save it as favorite (default),
press F5 (no record is displayed), remove the filter.

opw-1925079
opw-1925479

Fixes odoo#30087
Closes odoo#31254

robodoo pushed a commit that referenced this pull request Feb 22, 2019

[FIX] web: kanban: rendering of async widgets
This rev. fixes 3 issues with async (field) widgets in the kanban
view.

From rev. 5faec34, widget'$el doesn't exist before start. This
means that for async widgets, one can't interact with the widget's
$el right after calling appentTo. In KanbanRecord, this is exactly
what we did for both field widgets (<field name=.../>) and widgets
(<widget name=.../>).

Moreover, when the kanban view was updated (e.g. when the user
refined the search using the search view), and the rendering was
async (because of the presence of an async widget), the renderer
didn't wait at all for the widget to be ready before updating the
view. This caused flickering, mostly, but also a crash in
accounting with the JournalDashboardGraph widget (because
on_attach_callabck was called before the widget was ready). To
reproduce this particular issue, go to accounting, add a filter
that doesn't match any record and save it as favorite (default),
press F5 (no record is displayed), remove the filter.

opw-1925079
opw-1925479

Fixes #30087
Closes #31254

closes #31327

@robodoo robodoo closed this Feb 22, 2019

@robodoo robodoo added closed 💔 and removed CI 🤖 labels Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.