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

Hi all

i have create record rule for object 'hr_timesheet_sheet.sheet' Form Timesheet

with domain [('user_id', '=', user.id)] 
create =1

write=1

update=1

delete = 1


its success with show only record by user_id the same. but when the user create in form Timesheet there is a warning like this


ValidateError
Field(s) `date_from, date_to` failed against a constraint: You cannot have 2 timesheets that overlap!
Please use the menu 'My Current Timesheet' to avoid this problem.
Error details:
AccessError
The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
(Document type: hr_timesheet_sheet.sheet, Operation: read)

but when i non active record rule for that form its successfully saved. anyone can explain why it could happen ? or maybe there is something wrong with the record rule that I create ?

Thanks !

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

Hello,

Try to modify your rule to be as:

 ['|', ('user_id', '=', False),('user_id', '=', user.id)] 

Hope this could help ...

อวตาร
ละทิ้ง
ผู้เขียน

its work !! :) thanks a lot

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ค. 16
3634
3
มิ.ย. 16
9149
1
ม.ค. 16
5575
1
ก.ย. 15
3918
1
ก.ค. 19
585