Odoo Help

0

booking

By
sihem
on 5/27/16, 2:33 PM 353 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) 


About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

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