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

Hi.

if i applied ir.rule for a particular model. Odoo shows a warning like this-

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
(Document type: store, Operation: unlink)

i want to change it. How can i do that?

thanks in advance.

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

Change in your odoo/models.py file.

find out _check_record_rules_result_count method.

@api.multi
def _check_record_rules_result_count(self, result_ids, operation):

and change only message in

raise AccessError(_('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \(self._description, operation))
อวตาร
ละทิ้ง
ผู้เขียน

hmm...found about it.....BTW, it is never a good thing to change in main odoo-server files......need to edit the method or overwrite it in my own models.....

yes, overriding is better way than changing in main file.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 22
2499
Javascript warning message แก้ไขแล้ว
1
มี.ค. 21
7420
1
พ.ค. 21
3994
1
ส.ค. 20
2655
2
ก.ค. 19
4114