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

[13.0] web_tree_dynamic_colored_field: colors attribute removed from tree #1479

Closed
guewen opened this issue Jan 9, 2020 · 8 comments
Closed

Comments

@guewen
Copy link
Member

guewen commented Jan 9, 2020

I'm migrating web_tree_dynamic_colored_field to 13.0.

In previous versions, we could define a dynamic colors attribute on tree views:

<tree position="attributes">
<attribute name="colors">color_field: lang</attribute>
</tree>

In odoo 13.0, the colors attribute has been removed from the rng schema: odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983

I thought we could extend the XML before the rng schema is built in: https://github.com/odoo/odoo/blob/6a420921818d741d48bf873e0a62a220c135fbfa/odoo/tools/view_validation.py#L173-L183
but it would require a cherry-pick and only one module would be able to do this. So it doesn't seem to be a good solution.

Any idea where we could store this in the tree's schema (https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/rng/tree_view.rng) or other idea?

@hbrunn @simahawk

@pedrobaeza
Copy link
Member

FYI, now it's done through decoration-{bs_class} (for example, decoration-info option).

Maybe you can store it in a key inside options attribute?

@guewen
Copy link
Member Author

guewen commented Jan 9, 2020

🤦‍♂️ I thought there was no options on the <tree> because I didn't see it in the rng file, but it's in the common rng file. Thanks @pedrobaeza, I'll try this.

guewen added a commit to guewen/web that referenced this issue Jan 9, 2020
The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
guewen added a commit to guewen/web that referenced this issue Jan 9, 2020
The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
guewen added a commit to guewen/web that referenced this issue Jan 9, 2020
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
@guewen
Copy link
Member Author

guewen commented Jan 9, 2020

Done in d989dbd

@pedrobaeza
Copy link
Member

Great, closing this then.

@guewen
Copy link
Member Author

guewen commented Jan 10, 2020

Hmm no, actually the options attribute does not exist on tree 😭

2020-01-10 08:49:30,049 16574 ERROR test odoo.tools.view_validation: <string>:1:0:ERROR:RELAXNGV:RELAXNG_ERR_NOELEM: Expecting an element control, got nothing
2020-01-10 08:49:30,049 16574 ERROR test odoo.tools.view_validation: <string>:1:0:ERROR:RELAXNGV:RELAXNG_ERR_INVALIDATTR: Invalid attribute options for element tree
2020-01-10 08:49:30,049 16574 ERROR test odoo.tools.view_validation: Invalid XML:  Get RNG validator and validate RNG file.

@guewen guewen reopened this Jan 10, 2020
@pedrobaeza
Copy link
Member

Ouch

@simahawk
Copy link
Contributor

@guewen what about hacking decoration- handling in ListRenderer?
By default it ignores any option not matching theirs but you could support decoration-color.

@guewen
Copy link
Member Author

guewen commented Jan 10, 2020

The problem is not the the js part but the RelaxNG schema that won't allow to use decoration-color in the <tree> element:

https://github.com/odoo/odoo/blob/7615030fb293356fc5540ba65afa66ff71b207c1/odoo/addons/base/rng/tree_view.rng#L39-L46

guewen added a commit to guewen/web that referenced this issue Feb 4, 2020
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
phuctranfxvn pushed a commit to phuctranfxvn/web that referenced this issue Feb 7, 2021
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
akavanom pushed a commit to akavanom/web that referenced this issue Nov 29, 2021
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
amh-mw pushed a commit to amh-mw/web that referenced this issue Feb 14, 2022
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
Herqs pushed a commit to focusate/web-oca that referenced this issue Apr 5, 2022
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
moaadbourhim pushed a commit to moaadbourhim/web that referenced this issue Apr 23, 2022
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
amh-mw pushed a commit to amh-mw/web that referenced this issue Oct 14, 2022
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
dz0 pushed a commit to versada/web that referenced this issue Mar 12, 2024
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
drewes pushed a commit to agrista/odoo-web that referenced this issue May 7, 2024
Use 'options' instead of 'colors' on tree views

The colors attribute has been removed from the RelaxNG schema in
Odoo [0], so use the 'options' instead.

Closes OCA#1479

[0] odoo/odoo@7024f8d#diff-e9acd2f731cc01f302055b6e232df983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants