I have a security group, and I want to apply a raise error to a button to cancel payments through a group (boolean), if the group is not activated and they try to cancel a payment, a raise error will appear where it specifies that it cannot cancel payments if you do not have access permissions.
Is this possible?
odoo 10 community, thanks!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
Hi,
You can create a new security group and assign this user group to the corresponding button. Once the group is assigned to the button, the button will be visible only for the users in the specified group.
by adding groups="external_of_group" to the button directly or via inheritance will do the above.
If you don't need this and button has to be visible always and has to raise warning, you can add below code to the first part of the button.
if not self.env.user.has_group('group_external_id'):
raise AccessError(_("Do not have access"))
Thanks & Regards
Thanks!
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
0
เม.ย. 21
|
3678 | ||
|
1
มี.ค. 15
|
4757 | ||
500: Internal Server Error After Pay Now
แก้ไขแล้ว
|
|
4
ส.ค. 22
|
12306 | |
|
0
ส.ค. 20
|
3084 | ||
|
3
มิ.ย. 17
|
8146 |