please help for the below,
- how to do this in custom module or odoo Settings -> Technical ?
Contacts created by the Sales person to be hidden from others but only visible to himself and his manager
regards
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
please help for the below,
- how to do this in custom module or odoo Settings -> Technical ?
Contacts created by the Sales person to be hidden from others but only visible to himself and his manager
regards
Hi,
Refer to the code
Ensure that the manager has access to
view all contacts, regardless of the custom filter. This can be done by
setting appropriate access rights for the manager role.
Here is a sample Python code that illustrates how to implement such a custom filter in a model (e.g., res.partner for contacts):
from odoo import models, fields class ResPartner(models.Model): _inherit = 'res.partner' visible_to_salesperson = fields.Boolean(string='Visible to Salesperson', default=lambda self: self.env.user.has_group('sales.group_sales_manager')) # Optionally, you can set access control for the custom field # visible_to_salesperson = fields.Boolean(string='Visible to Salesperson', compute='_compute_visible_to_salesperson', store=True) # Example of access control using a compute method # def _compute_visible_to_salesperson(self): # for record in self: # record.visible_to_salesperson = self.env.user.has_group('sales.group_sales_manager') or record.user_id == self.env.user
Hope it helps
thanks @Cybrosys for help, will check it.
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
3
okt. 23
|
3704 | ||
|
1
jan. 24
|
1637 | ||
|
1
mei 25
|
2411 | ||
|
1
apr. 25
|
3428 | ||
|
1
apr. 25
|
4245 |