El 25/01/18 a les 15:24, Luciano Rossi ha escrit: > Hi! > > I need to create an interface to manage the users. For now, I add to my > module the menu item Administration -> Users. > > The problem that i'm having, is that I want to restrict the groups that > the user can add or remove from the groups field (many2many). > > I added a restriction to the groups field, modifying the definition of > the domain attribute of the groups field, so when choosing the groups to > be added, it will restrict the list of them. But, I don't know how I can > restrict the lines (groups) that the user can remove.
The user will be allowed to add and remove all the groups that are allowed by domain. > > For example, the user can add to the user the groups Accounts and > Purchase. But, if the user already has the group Sale, I do not want > that this group to be remove it. > > Any idea? If the idea is to prevent removal of existing groups I will probably make the current user groups readonly and add a function field which is empty by default and it's used to add new groups to the user. But for sure, this should be done with access groups, so there are groups that are allowed to write directly and remove groups. Hope it helps. -- Sergi Almacellas Abellana www.koolpi.com Twitter: @pokoli_srk -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/3fba2a70-db35-4787-6d97-18d7605899e1%40koolpi.com.
