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

Hi all,

I want to hide the page of "Measurement Setting" when the field "test_type_id != 5". this setting works. If "test_type_id ==5" I want the user to enter values in "measure_data_ids" (o2m field). 

The problem is that "required ="test_type_id ==5" does not do the job. User can save the record with an empty "measure_data_id". Please correct me.     

     

   


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

you can add a constraint to check if the o2m is empty. So that if test_type_id==5 and length of o2m is 0, you can raise an error to stop the record in saving.

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

Hi K Ch Kumar,

Thank you very much. your suggestion works. 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 6 24
1267
1
thg 5 24
1435
0
thg 9 19
15422
0
thg 7 25
416
2
thg 7 25
35