Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

booking

By
sihem
on 5/27/16, 2:33 PM 153 views

j'ai un problème dans mon code source, une fois une chambre est réservée je peux plus la réservé même dans dans une période différente de la période de la première réservation s'il vous plait aidez moi    


i have a problem  in reservation room if a room is reserved i cant reserve it in an other period

def create(self,data):

if "room" in data:

room_id=data["room"]

roomentity=self.env['hotel.room'].browse(room_id)

if roomentity.is_cleaned:

if self.start_date<roomentity.end_date:

raise exceptions.Warning("room reserved in this period")

else:

roomentity.start_date=self.start_date

roomentity.end_date=self.end_date

else:

raise exceptions.Warning("room not clean")

return super(hotel_booking,self).create(data) 


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/27/16, 2:33 PM
Seen: 153 times
Last updated: 5/28/16, 12:22 AM