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

Hi,

I would like to apply a constraint on specific fields whatever the fileds that are modified.
For example I would like to check that field 'my_field' is checked whatever the filed that is changed :

@api.one
@api.constrains('write_date', 'create_date', 'my_field')
def my_constraints(self):
.../... Blabla raise ValdiationError

This part works well if my_field is modified, yet it's not thrown if another field is changed.
So the constraints does not apply each time you validate a record.
How is it possible to do so?

Do I need to override the write method?

regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 17
3941
1
thg 8 25
939
1
thg 8 25
1152
2
thg 7 25
3846
3
thg 7 25
1235