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

Hello,

I'm working on constraints for loan lines if the new entered date is less than the dedication start data user validation error must be raised

here's my function:


@api.onchange("loan_lines")
def edit_installment(self):
for loan in self:
for line in loan.loan_lines:
for i in list(line.date):
                 if i < line.date
        print(line.date)
        print(type(line.date))
    raise ValidationError(
_("you can not change the date to date before the start date of dedication"))


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 25
3613
0
thg 3 24
1363
0
thg 10 22
2545
1
thg 7 22
5411
0
thg 6 22
836