تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2620 أدوات العرض

Hello, I'm writing code for a custom module that allows users to only see a certain part of the information according to a custom group, for example I want users to only be able to see a record in the res.parter menu if who wants to see it is the assigned commercial

For this I am making queries from self.env['res.users'].browse(id registry) to see if registry user_id is equal to the uid and this works fine because if not the uid does not have permissions to see this registry change the view but my problem is that in tests I run it from a button in the view

I need the check_permission(self) function of my model to be executed automatically whenever the view changes in all views obviously

Does anyone know how I can do this?

I already tried with fields_view_get and it works but it is executed twice (at the same time) when a specific model is loaded but clearly I need it to be executed whenever some action is done



Odoo 14.0.20221202

Community Edition

Debian 10


الصورة الرمزية
إهمال
أفضل إجابة

Hi, have you find any solution ?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
5
أكتوبر 24
32532
1
يوليو 23
7195
2
يوليو 22
11419
2
أكتوبر 21
3223
0
أغسطس 21
1971