콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4622 화면

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

관련 게시물 답글 화면 활동
0
7월 16
3637
3
6월 16
9151
1
1월 16
5577
1
9월 15
3924
1
7월 19
585