Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How i can compare fields.Date with another?

Odoberať

Get notified when there's activity on this post

This question has been flagged
viewsmodelsfields.date
3 Replies
7238 Zobrazenia
Avatar
Tihomir Stoychev Stoychev

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?  

0
Avatar
Zrušiť
Fatih Piristine

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

Sehrish

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

Avatar
Pawan Kumar Sharma
Best Answer

Hello @Tihomir,

You can use following filter domain for remove overlap bookings for your hotel.

domain = [('start_date', '<=', self.booking_upto),('end_date', '>=', self.booking_from)]
booking = self.env['hotal.booking'].search(domain)

where booking_upto and booking_from date fields from 'hotel.booking'. And start_date & end_date field model from where you booking.

Also you can check this principle in HR Management.

Hopefully this will helpful for you.

1
Avatar
Zrušiť
Avatar
San
Best Answer

Buen día.

Yo comenzaría por hacer la prueba con el módulo de citas https://www.youtube.com/watch?v=nSnc5W5cuwQ, registrando cada habitación como un recurso.

1. Registrar un recurso por tipo de habitación que tienes en tu hotel.

2. Crear los horarios disponibles, poniendo el tiempo en base a la cantidad de habitaciones disponibles, para que puedan reservar en un día sólo la cantidad de habitaciones de ese tipo que se tienen disponibles, Internamente la hora de la habitación para llevar el control la podrían tomar como la habitación, ejemplo: reserva de la habitación 11 h 00, sería la habitación 211.

3. Hacer un pequeño ajuste en la página para que muestre el día de reserva en lugar de la hora.

Puedes descargar completamente gratis y con usuarios ilimitados, la aplicación de página WEB y citas, agregando módulos gratuitos como blogs, chat en linea, presentaciones, flotillas etc... en el siguiente link:  https://www.odoo.com/es_ES/page/appointments

Espero la idea le sea de ayuda. Saludos!

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Viewing Field from another Model
views models
Avatar
Avatar
1
feb 18
4106
Why not all model fields shown in defalt view?
views models
Avatar
Avatar
1
feb 16
4331
Adjust View Order by Field
views models
Avatar
1
mar 15
4882
Want to make a field invisible based on another field in a view Solved
views python models
Avatar
Avatar
1
nov 23
3512
Can't create view (model not found) Solved
views models odoo10
Avatar
Avatar
Avatar
2
máj 23
8857
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now