跳至内容
菜单
此问题已终结
2 回复
617 查看

Can a note in Odoo 17 be restricted to internal users only, excluding companies or any other contacts?

Further explanation:

I want to ensure that my users can only tag internal employees in the chatter and not companies or any other contacts.

形象
丢弃
最佳答案

From code side, Filters out portal users or external users then Link the user to their corresponding record (because Odoo stores partner info for both users and contacts).

class ResPartner(models.Model): 
​ _inherit = 'res.partner' 


 
​def _message_partner_allowed(self): 
 
​""" Restrict @mention to only internal users (employees) """ 
  ​internal_users = self.env['res.users'].search([('share', '=', False)]) 
 
​return internal_users.mapped('partner_id')

形象
丢弃
相关帖文 回复 查看 活动
1
7月 25
1149
2
3月 25
1416
0
2月 25
1094
0
2月 25
1236
0
2月 25
1202