Skip to content

FIX unable assign role_line with same role different companies

Related to this card.

I feel that perhaps it is a BUG or a inconsistence of the OCA module 'base_user_role_company' because this domain at xml-view level it is not allowing to add additional role line ids if the role_id is already assigned to the user, but we need to be able to assign the same Role to a user but for different companies.

The module 'base_user_role_company' already have a sql-constrain implemented at res.users.role.line model that it taking care of no user+role+company duplicities: _sql_constraints = [ ( "user_role_uniq", "unique (user_id,role_id,company_id)", "Roles can be assigned to a user only once at a time", ) ]

So I feel that we can proceed to teke out this xml-view domain. I you @enricostn & @DaniilDigtyar ara agre, we can also proceed to suggest it as a MR proposal to the OCA repo of 'res.users.role.line'

Merge request reports