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
Qweb t-att-groups errors #5058
Comments
Is there a way to apply "groups" visibility to qweb xml files? |
Any insight on this one? |
It is currently possible to do groups-based filtering in qweb-python (using the |
So... two things:
|
I don't understand the question.
It's not possible in qweb templates used in javascript. It's possible in qweb templates used in python (qweb views if you will). |
I am trying to understand when happens each case. (Could be added to documentation, for newcomers, as it means quite a diffence in behaviour). So, the qweb file (or template) will always be the same, but its final behaviour will depend on if its added from javascript, or from a xml view (qweb view, like kanban views). |
There are some differences outlined in the qweb section of the documentation already, though AFAIK the groups attribute is not documented (even on the Python side).
Well yeah, there's the basic qweb language/idea, then there are two different implementations which are not completely identical. So the basics are the same, but the details may not be. |
In documentation (https://www.odoo.com/documentation/8.0/reference/qweb.html#attributes) it is explained with |
And any |
I see, so it is intended mainly for html attributes like title, src, width, and so on, but not for the kind of field control attributes used in XML views. |
It really is intended only for HTML attributes, and can do nothing else. Which is why there are separate directives/attributes for more meta-control at the qweb level (e.g. t-if) |
OK, perfect then. I suggest to add that explanation to documentation to avoid ambiguity. |
Qweb tag t-att-groups seems to missbehave
Trying to use t-att-$name (as explained in official documentation in https://www.odoo.com/documentation/8.0/reference/qweb.html#attributes ), is ignored in one case, gives error in other (see both cases below, in "Current behaviour").
Impacted versions:
Prior considerations
Steps to reproduce:
Current behavior:
t-att-groups="chat_manager"
nothing happens, so chat button remains visible for everyone.t-att-groups="my_module.chat_manager"
, some errors arise and button is not available for anyone. The errors arisen are popup only (no log, even in debig mode):Odoo Error del cliente Uncaught Error: QWeb2 - template['im_chat.ImTopButton']: Runtime Error: TypeError: Cannot read property 'group_my_module_manager' of undefined http://localhost:8069/web/js/web.assets_common/05b35c0:1020
(NOTE: "Error del cliente" means "Client error" in English)
TypeError: dict.my_module is undefined http://localhost:8069/web/static/lib/qweb/qweb2.js line 400 > Function:8
Expected behavior:
The text was updated successfully, but these errors were encountered: