Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2059 มุมมอง

Hello everyone!

I need to restrict the creation of opportunities in the CRM module, that's why I have a custom module that inherits directly from "crm.lead". What I need is to disable the "Create" button when the "type_executive" attribute (res.users) of the current user is different from 4. How can I do it? The code I am using in the inherited view is as follows (currently nobody can create opportunities):


 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Diego!

The approach you are suggesting is not ideal - let me explain why:
The create button in the kanban is not the only place where users can create opportunities from → they can come from a different view (e.g. leads), they can try importing the records or they can create a new opportunity through sale order in debug mode:

Normally when you need to restrict someone from Creating a record in Odoo, you create a new Access group (res.groups), where you define the CRUD for the specific record. As it will prevent the users from creating opportunities whatsoever, they won´t be able to create them from the "alternative" places either.

Hope my answer helped!

Sincerely

Ivana from Edoo.is

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 21
3228
1
มิ.ย. 24
3203
0
มิ.ย. 24
1232
Remove kanban view from crm pipeline แก้ไขแล้ว
2
ก.ย. 22
3075
4
มิ.ย. 22
1302