HOW I CAN CALCULATE DIFFERENCE BETWEEN TWO DATE
I HAVE A CHAMP X_STUDIO_DATE_DEPART AND X_STUDIO_DATE_ARRIVE
AND I WANT TO CALCULATE THE DEFERENCE BETWEEN TWO DAYS IN X_STUDIO_TOTAL_DAYS
CAN
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
HOW I CAN CALCULATE DIFFERENCE BETWEEN TWO DATE
I HAVE A CHAMP X_STUDIO_DATE_DEPART AND X_STUDIO_DATE_ARRIVE
AND I WANT TO CALCULATE THE DEFERENCE BETWEEN TWO DAYS IN X_STUDIO_TOTAL_DAYS
CAN
Hello,
Please check out the following documentation.
https://www.geeksforgeeks.org/python-program-to-find-number-of-days-between-two-given-dates/
Hope it helps.
Thanks,
info@creyox.com
dont working :/
Hi
you can use a compute function for X_STUDIO_TOTAL_DAYS
if record.x_studio_date_depart > record.x_studio_date_arrive:
raise ValidationError('Depart should not be greater than the Arrive.')
else:
start_date = datetime.strptime(record.x_studio_date_depart, '%Y-%m-%d')
end_date = datetime.strptime(record.x_studio_date_arrive, '%Y-%m-%d')
delta = end_date - start_date
record.x_studio_total_days = delta.days
Regards
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 2 24
|
1384 | ||
|
2
thg 2 19
|
7876 | ||
|
0
thg 3 16
|
4249 | ||
|
2
thg 9 23
|
5269 | ||
ODOO Studio Calculate
Đã xử lý
|
|
1
thg 10 18
|
4746 |