Skip to content

[FIX] web_m2x_options: Fix error in tree views with many2many_tags - #1155

Merged
pedrobaeza merged 1 commit into
OCA:11.0from
Tecnativa:11.0-web_m2x_options-fix_m2m_tags_list_view
Jan 16, 2019
Merged

[FIX] web_m2x_options: Fix error in tree views with many2many_tags#1155
pedrobaeza merged 1 commit into
OCA:11.0from
Tecnativa:11.0-web_m2x_options-fix_m2m_tags_list_view

Conversation

@yajo

@yajo yajo commented Jan 16, 2019

Copy link
Copy Markdown
Member

The method _onOpenColorPicker is defined on FormFieldMany2ManyTags, not in FieldMany2ManyTags, so it can only be called on its descendants.

Otherwise, clicking on a many2many_tags tag when found in a tree view produces an error such as:

TypeError: self._onOpenColorPicker is not a function

http://localhost/web_m2x_options/static/src/js/form.js:354
Rastreo de error:
_onOpenBadge@http://localhost/web_m2x_options/static/src/js/form.js:354:17
proxy/<@http://localhost/web/static/src/js/core/mixins.js:279:20
dispatch@http://localhost/web/static/lib/jquery/jquery.js:4640:50
add/elemData.handle@http://localhost/web/static/lib/jquery/jquery.js:4309:41

@Tecnativa

@yajo yajo self-assigned this Jan 16, 2019
@yajo yajo added this to the 11.0 milestone Jan 16, 2019
@pedrobaeza

Copy link
Copy Markdown
Member

With this, the tag will be clickable for selecting color? I think this is not the default behavior, and for this module, I would say that it's something not wanted.

@yajo

yajo commented Jan 16, 2019

Copy link
Copy Markdown
Member Author

This patch only fixes the bug, but the logic beneath remains the same as it was.

@pedrobaeza

Copy link
Copy Markdown
Member

Yeah, but I'm asking what is the logic, and if it's what I'm saying, we should inhibit it.

@yajo

yajo commented Jan 16, 2019

Copy link
Copy Markdown
Member Author

If the widget is supposed to open the record when clicking on the tag, or if it is marked as no_color_picker: true, then the color picker will not display.

Otherwise it will.

The method `_onOpenColorPicker` is defined on `FormFieldMany2ManyTags`, not in `FieldMany2ManyTags`, so it can only be called on its descendants.

Otherwise, clicking on a `many2many_tags` tag when found in a tree view produces an error such as:

    TypeError: self._onOpenColorPicker is not a function

    http://localhost/web_m2x_options/static/src/js/form.js:354
    Rastreo de error:
    _onOpenBadge@http://localhost/web_m2x_options/static/src/js/form.js:354:17
    proxy/<@http://localhost/web/static/src/js/core/mixins.js:279:20
    dispatch@http://localhost/web/static/lib/jquery/jquery.js:4640:50
    add/elemData.handle@http://localhost/web/static/lib/jquery/jquery.js:4309:41
@yajo
yajo force-pushed the 11.0-web_m2x_options-fix_m2m_tags_list_view branch from 36f2571 to ddbbe81 Compare January 16, 2019 11:51
@yajo

yajo commented Jan 16, 2019

Copy link
Copy Markdown
Member Author

I fixed a little bug, this should be ready to merge.

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why do you need separated var definitions

@pedrobaeza
pedrobaeza merged commit 8bf48e9 into OCA:11.0 Jan 16, 2019
@pedrobaeza
pedrobaeza deleted the 11.0-web_m2x_options-fix_m2m_tags_list_view branch January 16, 2019 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants