Hello everyone,
I have inherite pos.config model, adding a field many2one for user.groups, that user will choose a group, base on this field, I will hide some pos button in pos,
my pos.config looks like this:
from odoo import api, fields, models
class PosConfig(models.Model):
_inherit = 'pos.config'
groups_id = fields.Many2one('res.groups', string='Allow groups')
Have add it in the pos.config sucessfully, can give it a value, I want to compare this group with the current group ids for current user, if this group is in the current groups I will show fields, otherwise no.
So in pos.xml template, in NumpadWidget widget, I use this:
<t t-foreach="widget.pos.user.groups_id" t-as="gr">
<t t-if="widget.pos.config.groups_id == gr">
<p> it is ok</p>
</t>
</t>
the issue is:
widget.pos.user.groups_id shows only ids, so gr only id
widget.pos.config.groups_id shows (id, name)
I need to get id for both, or get name for both.
Can someone help me?
Thanks