Skip to Content
Menu
This question has been flagged
1 Odpoveď
1406 Zobrazenia

In crm.team, I add a new many2many called member_ids

I want in menu "My pipeline", the leader of crm.team can see members opportunity as well


My approach is to create a new model called "accessable.res.users" (basically this model just contain 3 field. ID related to user_id.id, user_id, and name related to user_id.name) because when I make a many2many field in crm.lead called "visible_res_user_ids" that use comodel "res.users", then make notebook page tree with "visible_res_user_ids" field, when I open the form, nothing happen. the form is not opened and the page still responsive. just cannot open the form because it tried to read res.users. but if I remove the notebook page, it can open the form


So I assume res.users cannot be accessed by non admin users





Then I test it with filter before put it inside the view domain. 

I assume I have to set the users "Sales" access right to "User: All Documents" to make him can see other document then I filter it

But even after I change that, it still not working

What is wrong with my code?



I'm planning to follow this post https://www.odoo.com/forum/help-1/how-to-inherit-and-change-the-domain-of-standard-rules-in-odoo-8-0-69326 to change the domain from odoo base


Avatar
Zrušiť
Autor Best Answer

I decide to change the way I approach. Basically in domains_force, it use 2 models for comparison. The current model that we open and res.users. So I make a new field in res.users to store what field can a user view. This way I can manage what a user can see when their "Sales" access right is "User: One document only". I change ir.rule with the id crm_rule_personal_lead then in the crm.lead, I change the value in the res.users field. But this comes with another problem. See this link 


Code with updating res.users is not working in server but working in local

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
jún 24
2286
0
nov 22
80
1
jún 22
7008
1
júl 21
2671
1
júl 21
4054