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

I want to prevent a user/group from editing a Purchase Order based on whether the partner reference field is blank or not. I tried to create a non global record rule with the following domain rule:

[('partner_ref', '=', False)]

applied to create, write and delete. As expected, the user can't create, delete or change a purchase order with a non blank partner reference. But, if the user create a record with a blank partner reference, save it, and then edit, he can save it with a non blank field, which is not what I want. How can I prevent that?

الصورة الرمزية
إهمال

Set the permission for particular user or group in ir.model.access.csv under security.

الكاتب

They already have all model access permissions, in addition to those I want to limit based on a specific field value, hence the use of Record Rules.

أفضل إجابة

Hello,

You can, by view inheritance, hide the partner_ref field for that group, it should work.

الصورة الرمزية
إهمال
الكاتب

The field should be visible to the user, but read-only.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أكتوبر 20
9162
0
أكتوبر 19
3882
0
يونيو 16
3247
2
فبراير 16
4590
2
فبراير 25
1992