When extending a qweb template in v8, is it possible to add the groups policies to elements as in views*? How?
(*) Adding groups="my_module.my_security_group"
I have tried to hide the im_chat button at the top and show it only to some managers group, but it doesn't work as expected and has no result. The code:
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-extend="im_chat.ImTopButton">
<t t-jquery="li" t-operation="replace">
<li t-att-title='_t("Display Instant Messaging")' groups="my_module.group_my_module_manager">
<a href="#">
<i id="oe_topbar_imbutton_icon" class="fa fa-comments-o"/>
</a>
</li>
</t>
</t>
</templates>
I have also tried to specify the groups policy through t-field-options, with no luck.
<li t-att-title='_t("Display Instant Messaging")' t-field-options='{"groups": "crm_ticket_platforms.group_crm_ticket_platforms_manager"}'>
UPDATE:
Reading more, I have tried using tag "t-att-groups", as explained in official documentation (a-att-$name), but without result. As that expression is documented and supposed to work, I have opened an issue in Github: https://github.com/odoo/odoo/issues/5058
Let's see how it ends.
UPDATE 2:
With some comments on issue https://github.com/odoo/odoo/issues/5058 it is clear I was missunderstanding the purpose of qweb t-att-$name attributes. It is intended for html attributes only (width, href, etc.), not for Odoo meta-data as group security policy.
It is stated I could use t-if, but haven't tested it yet. It surely uses some akward domain, as usual.