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

i want If period is selected then not allow to select other than period date on Details timesheet page.

Do we have any module for this?



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

Hi, you to need customise this either you can add constraint or on_change

อวตาร
ละทิ้ง

Hey Sushma,

Agree from your answer but i have question can we apply compute method for this problem ?

Hello,

This may help you guys !

@api.onchange('date')

def check_date_in_timesheet(self):

for ts_line in self:

if ts_line.sheet_id:

if ts_line.date < ts_line.sheet_id.date_from or ts_line.date > ts_line.sheet_id.date_to:

res = {'warning': {

'title':'Warning',

'message':'The date should be in between timesheet Dates',

}

}

return res

Thanks !