Hello!
Im pretty newbie on this but im trying to learn and expand my knowledge.
I have a hotel which has a booking system, this booking system takes from user 2 dates , booking start and booking end. I would like to check when a new user tries to make a new booking if his date inserted is not overlaping another booking, do you copy me?
I think is by using the constrains odoo gives but how i can compare dates? For example if user a introduces that he wants a booking from 02/09/2018 to 04/09/2018 and user b tries to make a book for 03/09/2018 it should tell him that it is not possible. But how? I thought on parsing the result to EPOCH/posix time but i also dont know how to do it, im also a newbie on python.
Someone can help me?
this is not a question related to odoo. you should first look into data structures and learn them. then go ahead and learn little bit of python date: https://docs.python.org/3.4/library/datetime.html
Playing with dates in python:
For date manipulation
1- http://learnopenerp.blogspot.com/2018/01/python-date-manipulation.html
For date formatting
2- http://learnopenerp.blogspot.com/2018/02/python-strftime-datetime-formatting.html
For adding time periods etc
3- http://learnopenerp.blogspot.com/2018/02/python-timedelta.html