Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
10899 Lượt xem

Hi,

I nee to make a record as readonly .That means,I have my attendace and also have timesheets,

If my attendance is zero,I need to make that day's timesheet as readonly and show as absent

How could I do this?

Please help


Thanks in advance

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

1) You can create a custom constraint on timesheet object. The constraint will check your attendance for the date selected in the timesheet and the employee and if there no attendance, raise an exception like "You cannot fill the timesheet for the absent day".

2) Create a compute boolean field (Is Absent) in timesheet object. Check for the attendance of the day for the user/employee and if it is absent, set True in the field. Now, based on this boolean field, add attrs in the timesheet line in xml and make it readonly if Absent is True.


Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for this,and I'll try it

Câu trả lời hay nhất

Hi Veni,

I hope it will help for you..

<field name="fieldname" readonly="1">

<tree>

inside your tree fields here....

</tree>

</field>


Thank You.

Ảnh đại diện
Huỷ bỏ

<field name="fieldname" attrs="{'readonly':[('state', '=', "done")]}">

<tree>

inside your tree fields here....

</tree>

</field>

Tác giả

I think you couldn't understand my problem.

Suppose I have a new timesheet and I didn't fill it, What I need is,I have to check my attendance If it is zero then check with the corresponding date and create a record with the date and mark it as absent.This is my problem

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 25
2089
1
thg 1 22
18526
3
thg 7 19
5417
4
thg 11 20
7906
1
thg 8 20
3961