Rémi FRANÇOIS
4 years ago
commit
956b3c290f
21 changed files with 1252 additions and 0 deletions
-
2pos_restaurant_table_booking/__init__.py
-
38pos_restaurant_table_booking/__manifest__.py
-
BINpos_restaurant_table_booking/__pycache__/__init__.cpython-37.pyc
-
337pos_restaurant_table_booking/i18n/fr.po
-
332pos_restaurant_table_booking/i18n/pos_restaurant_table_booking.pot
-
5pos_restaurant_table_booking/models/__init__.py
-
BINpos_restaurant_table_booking/models/__pycache__/__init__.cpython-37.pyc
-
BINpos_restaurant_table_booking/models/__pycache__/res_config_settings.cpython-37.pyc
-
BINpos_restaurant_table_booking/models/__pycache__/restaurant_booking.cpython-37.pyc
-
BINpos_restaurant_table_booking/models/__pycache__/restaurant_table.cpython-37.pyc
-
BINpos_restaurant_table_booking/models/__pycache__/restaurant_table_booking.cpython-37.pyc
-
12pos_restaurant_table_booking/models/res_config_settings.py
-
143pos_restaurant_table_booking/models/restaurant_booking.py
-
14pos_restaurant_table_booking/models/restaurant_table.py
-
17pos_restaurant_table_booking/models/restaurant_table_booking.py
-
24pos_restaurant_table_booking/security/ir_model_access.xml
-
30pos_restaurant_table_booking/views/res_config_settings.xml
-
137pos_restaurant_table_booking/views/restaurant_booking.xml
-
29pos_restaurant_table_booking/views/restaurant_floor.xml
-
29pos_restaurant_table_booking/views/restaurant_table.xml
-
103pos_restaurant_table_booking/views/restaurant_table_booking.xml
@ -0,0 +1,2 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from . import models |
@ -0,0 +1,38 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
{ |
||||
|
'name': "POS Restaurant Table Booking", |
||||
|
'version': '1.0.0', |
||||
|
'summary': """ |
||||
|
""", |
||||
|
'description': """ |
||||
|
""", |
||||
|
'author': "La Case", |
||||
|
'website': "http://www.lacase-jeux.com", |
||||
|
'maintainer': "La Case", |
||||
|
'license': 'AGPL-3', |
||||
|
'category': 'Point of Sale', |
||||
|
'depends': [ |
||||
|
'pos_restaurant', |
||||
|
], |
||||
|
'excludes': [], |
||||
|
'external_dependencies': {}, |
||||
|
'data': [ |
||||
|
'security/ir_model_access.xml', |
||||
|
'views/res_config_settings.xml', |
||||
|
'views/restaurant_booking.xml', |
||||
|
'views/restaurant_floor.xml', |
||||
|
'views/restaurant_table_booking.xml', |
||||
|
'views/restaurant_table.xml', |
||||
|
], |
||||
|
'qweb': [], |
||||
|
'css': [], |
||||
|
'images': [], |
||||
|
'demo': [], |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
'pre_init_hook': '', |
||||
|
'post_init_hook': '', |
||||
|
'uninstall_hook': '', |
||||
|
} |
@ -0,0 +1,337 @@ |
|||||
|
# Translation of Odoo Server. |
||||
|
# This file contains the translation of the following modules: |
||||
|
# * pos_restaurant_table_booking |
||||
|
# |
||||
|
msgid "" |
||||
|
msgstr "" |
||||
|
"Project-Id-Version: Odoo Server 14.0+e\n" |
||||
|
"Report-Msgid-Bugs-To: \n" |
||||
|
"POT-Creation-Date: 2020-10-26 13:59+0000\n" |
||||
|
"PO-Revision-Date: 2020-10-26 13:59+0000\n" |
||||
|
"Last-Translator: \n" |
||||
|
"Language-Team: \n" |
||||
|
"MIME-Version: 1.0\n" |
||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||
|
"Content-Transfer-Encoding: \n" |
||||
|
"Plural-Forms: \n" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "" |
||||
|
"<i icon=\"fa-exclamation-triangle\"/>\n" |
||||
|
" <span class=\"ml8\">The total seats of selected tables is lower than the people count.</span>" |
||||
|
msgstr "<i icon=\"fa-exclamation-triangle\"/>\n" |
||||
|
" <span class=\"ml8\">Le nombre de places cumulé des tables sélectionnées est inférieur à l'effectif.</span>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "<span>from</span>" |
||||
|
msgstr "<span>de</span>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "<span>to</span>" |
||||
|
msgstr "<span>à</span>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Duration : </strong>" |
||||
|
msgstr "<strong>Durée : </strong>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Start : </strong>" |
||||
|
msgstr "<strong>Début : </strong>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>People count : </strong>" |
||||
|
msgstr "<strong>Effectif : </strong>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Stop : </strong>" |
||||
|
msgstr "<strong>Fin : </strong>" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.actions.act_window,name:pos_restaurant_table_booking.restaurant_booking_act_window |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_booking_menu |
||||
|
msgid "All bookings" |
||||
|
msgstr "Toutes les réservations" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__available_table_ids |
||||
|
msgid "Available tables" |
||||
|
msgstr "Tables disponibles" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_booking_root_menu |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.res_config_settings_form |
||||
|
msgid "Bookings" |
||||
|
msgstr "Réservations" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_capacity |
||||
|
msgid "Capacity" |
||||
|
msgstr "Capacité" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_capacity_ok |
||||
|
msgid "Capacity OK" |
||||
|
msgstr "Capacité OK" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__color |
||||
|
msgid "Color" |
||||
|
msgstr "Couleur" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_res_config_settings |
||||
|
msgid "Config Settings" |
||||
|
msgstr "Paramètres de config" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__create_uid |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__create_uid |
||||
|
msgid "Created by" |
||||
|
msgstr "Créé par" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__create_date |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__create_date |
||||
|
msgid "Created on" |
||||
|
msgstr "Créé le" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__date |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Date" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__datetime_start |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__datetime_start |
||||
|
msgid "Date start" |
||||
|
msgstr "Date début" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__datetime_stop |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__datetime_stop |
||||
|
msgid "Date stop" |
||||
|
msgstr "Date fin" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings__default_duration |
||||
|
msgid "Default duration" |
||||
|
msgstr "Durée par défaut" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings__display_name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__display_name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table__display_name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__display_name |
||||
|
msgid "Display Name" |
||||
|
msgstr "Nom affiché" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__duration |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__duration |
||||
|
msgid "Duration" |
||||
|
msgstr "Durée" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Filters" |
||||
|
msgstr "Filtres" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Group By" |
||||
|
msgstr "Grouper par" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings__id |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__id |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table__id |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__id |
||||
|
msgid "ID" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings____last_update |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking____last_update |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table____last_update |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking____last_update |
||||
|
msgid "Last Modified on" |
||||
|
msgstr "Dernière modification le" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__write_uid |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__write_uid |
||||
|
msgid "Last Updated by" |
||||
|
msgstr "Dernière modification par" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__write_date |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__write_date |
||||
|
msgid "Last Updated on" |
||||
|
msgstr "Dernière mise à jour le" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__name |
||||
|
msgid "Name" |
||||
|
msgstr "Nom" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.actions.act_window,name:pos_restaurant_table_booking.create_new_booking_act_window |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_new_booking_menu |
||||
|
msgid "New booking" |
||||
|
msgstr "Nouvelle réservation" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next saturday" |
||||
|
msgstr "Samedi prochain" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next sunday" |
||||
|
msgstr "Dimanche prochain" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next wednesday" |
||||
|
msgstr "Mercredi prochain" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next week" |
||||
|
msgstr "Semaine prochaine" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__count |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__count |
||||
|
msgid "People count" |
||||
|
msgstr "Effectif" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_restaurant_table_booking |
||||
|
msgid "Resaturant table booking" |
||||
|
msgstr "Réservation de table (restaurant)" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_restaurant_table |
||||
|
msgid "Restaurant Table" |
||||
|
msgstr "Table de restaurant" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_restaurant_booking |
||||
|
msgid "Restaurant booking" |
||||
|
msgstr "Réservation (restaurant)" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table__bookable |
||||
|
msgid "Bookable" |
||||
|
msgstr "Réservable" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__booking_id |
||||
|
msgid "Booking" |
||||
|
msgstr "Réservation" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.actions.act_window,help:pos_restaurant_table_booking.restaurant_booking_act_window |
||||
|
msgid "Schedule a new booking." |
||||
|
msgstr "Programmer une nouvelle réservation" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__time_start |
||||
|
msgid "Start" |
||||
|
msgstr "Début" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__time_stop |
||||
|
msgid "Stop" |
||||
|
msgstr "Fin" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__table_id |
||||
|
msgid "Table" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_ids |
||||
|
msgid "Tables" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.actions.act_window,name:pos_restaurant_table_booking.restaurant_table_booking_act_window |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_booking_ids |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_table_booking_menu |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "Tables bookings" |
||||
|
msgstr "Réservations des tables" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.constraint,message:pos_restaurant_table_booking.constraint_res_config_settings_duration_positive |
||||
|
msgid "The default booking duration must be positive or null." |
||||
|
msgstr "La durée dee réservation par défaut doit êetre positive ou nulle." |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,help:pos_restaurant_table_booking.field_restaurant_table_booking__color |
||||
|
msgid "" |
||||
|
"The table's color, expressed as a valid 'background' CSS property value" |
||||
|
msgstr "" |
||||
|
"La couleur de la table, exprimée dans une valeur d'arrière-plan CSS correcte" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.res_config_settings_form |
||||
|
msgid "" |
||||
|
"This duration is applied to any new booking created in the point of sale." |
||||
|
msgstr "" |
||||
|
"Cette duréee sera appliquée aux nouvelles réservations créées." |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "This week" |
||||
|
msgstr "Cette semaine" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "Times" |
||||
|
msgstr "Horaires" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.actions.act_window,help:pos_restaurant_table_booking.restaurant_booking_act_window |
||||
|
msgid "" |
||||
|
"To book, you must provide a name, a date, start and stop hours, the people " |
||||
|
"count and one or more tables." |
||||
|
msgstr "" |
||||
|
"Pour réserver, vous devez fournir un nom, une date, des horaires, l'effectif du groupe " |
||||
|
"et une ou plusieurs tables." |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Today" |
||||
|
msgstr "Aujourd'hui" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Tomorrow" |
||||
|
msgstr "Demain" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Upcoming" |
||||
|
msgstr "À venir" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "hours" |
||||
|
msgstr "heures" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "pers." |
||||
|
msgstr "" |
@ -0,0 +1,332 @@ |
|||||
|
# Translation of Odoo Server. |
||||
|
# This file contains the translation of the following modules: |
||||
|
# * pos_restaurant_table_booking |
||||
|
# |
||||
|
msgid "" |
||||
|
msgstr "" |
||||
|
"Project-Id-Version: Odoo Server 14.0+e\n" |
||||
|
"Report-Msgid-Bugs-To: \n" |
||||
|
"POT-Creation-Date: 2020-10-26 14:00+0000\n" |
||||
|
"PO-Revision-Date: 2020-10-26 14:00+0000\n" |
||||
|
"Last-Translator: \n" |
||||
|
"Language-Team: \n" |
||||
|
"MIME-Version: 1.0\n" |
||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||
|
"Content-Transfer-Encoding: \n" |
||||
|
"Plural-Forms: \n" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "" |
||||
|
"<i icon=\"fa-exclamation-triangle\"/>\n" |
||||
|
" <span class=\"ml8\">Le nombre de places cumulé des tables sélectionnées est inférieur à l'effectif.</span>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "<span>from</span>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "<span>to</span>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Durée : </strong>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Début : </strong>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Effectif : </strong>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "<strong>Fin : </strong>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.actions.act_window,name:pos_restaurant_table_booking.restaurant_booking_act_window |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_booking_menu |
||||
|
msgid "All bookings" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__available_table_ids |
||||
|
msgid "Available tables" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_booking_root_menu |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.res_config_settings_form |
||||
|
msgid "Bookings" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_capacity |
||||
|
msgid "Capacity" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_capacity_ok |
||||
|
msgid "Capacity OK" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__color |
||||
|
msgid "Color" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_res_config_settings |
||||
|
msgid "Config Settings" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__create_uid |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__create_uid |
||||
|
msgid "Created by" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__create_date |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__create_date |
||||
|
msgid "Created on" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__date |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Date" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__datetime_start |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__datetime_start |
||||
|
msgid "Date début" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__datetime_stop |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__datetime_stop |
||||
|
msgid "Date fin" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings__default_duration |
||||
|
msgid "Default duration" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings__display_name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__display_name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table__display_name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__display_name |
||||
|
msgid "Display Name" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__duration |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__duration |
||||
|
msgid "Duration" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Filters" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Group By" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings__id |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__id |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table__id |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__id |
||||
|
msgid "ID" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_res_config_settings____last_update |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking____last_update |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table____last_update |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking____last_update |
||||
|
msgid "Last Modified on" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__write_uid |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__write_uid |
||||
|
msgid "Last Updated by" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__write_date |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__write_date |
||||
|
msgid "Last Updated on" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__name |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__name |
||||
|
msgid "Name" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.actions.act_window,name:pos_restaurant_table_booking.create_new_booking_act_window |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_new_booking_menu |
||||
|
msgid "New booking" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next saturday" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next sunday" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next wednesday" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Next week" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__count |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__count |
||||
|
msgid "People count" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_restaurant_table_booking |
||||
|
msgid "Resaturant table booking" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_restaurant_table |
||||
|
msgid "Restaurant Table" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model,name:pos_restaurant_table_booking.model_restaurant_booking |
||||
|
msgid "Restaurant booking" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table__bookable |
||||
|
msgid "Réservable" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__booking_id |
||||
|
msgid "Réservation" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.actions.act_window,help:pos_restaurant_table_booking.restaurant_booking_act_window |
||||
|
msgid "Schedule a new booking." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__time_start |
||||
|
msgid "Start" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__time_stop |
||||
|
msgid "Stop" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_table_booking__table_id |
||||
|
msgid "Table" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_ids |
||||
|
msgid "Tables" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.actions.act_window,name:pos_restaurant_table_booking.restaurant_table_booking_act_window |
||||
|
#: model:ir.model.fields,field_description:pos_restaurant_table_booking.field_restaurant_booking__table_booking_ids |
||||
|
#: model:ir.ui.menu,name:pos_restaurant_table_booking.restaurant_table_booking_menu |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "Tables bookings" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.constraint,message:pos_restaurant_table_booking.constraint_res_config_settings_duration_positive |
||||
|
msgid "The default booking duration must be positive or null." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model:ir.model.fields,help:pos_restaurant_table_booking.field_restaurant_table_booking__color |
||||
|
msgid "" |
||||
|
"The table's color, expressed as a valid 'background' CSS property value" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.res_config_settings_form |
||||
|
msgid "" |
||||
|
"This duration is applied to any new booking created in the point of sale." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "This week" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form |
||||
|
msgid "Times" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.actions.act_window,help:pos_restaurant_table_booking.restaurant_booking_act_window |
||||
|
msgid "" |
||||
|
"To book, you must provide a name, a date, start and stop hours, the people " |
||||
|
"count and one or more tables." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Today" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Tomorrow" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_search |
||||
|
msgid "Upcoming" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "heures" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: pos_restaurant_table_booking |
||||
|
#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt |
||||
|
msgid "pers." |
||||
|
msgstr "" |
@ -0,0 +1,5 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from . import res_config_settings |
||||
|
from . import restaurant_booking |
||||
|
from . import restaurant_table_booking |
||||
|
from . import restaurant_table |
@ -0,0 +1,12 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from odoo import models, fields |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
_inherit = 'res.config.settings' |
||||
|
|
||||
|
default_duration = fields.Float(string="Default duration", default_model='restaurant.booking') |
||||
|
|
||||
|
_sql_constraints = [ |
||||
|
('duration_positive', 'CHECK(default_duration >= 0)', "The default booking duration must be positive or null.") |
||||
|
] |
@ -0,0 +1,143 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from datetime import datetime as dtdatetime, time as dttime |
||||
|
from odoo import models, fields, api |
||||
|
from pytz import timezone, utc |
||||
|
|
||||
|
def float2time(fhours, seconds=False): |
||||
|
hrs = int(fhours) |
||||
|
fmin = (fhours - hrs) * 60 |
||||
|
min = int(fmin) |
||||
|
sec = 0 |
||||
|
if seconds: |
||||
|
fsec = (fmin - min) * 60 |
||||
|
sec = int(fsec) |
||||
|
return dttime(hrs, min, sec) |
||||
|
|
||||
|
|
||||
|
class RestaurantBooking(models.Model): |
||||
|
_name = 'restaurant.booking' |
||||
|
_description = "Restaurant booking" |
||||
|
_order = 'date, time_start, count desc' |
||||
|
|
||||
|
@api.model |
||||
|
def default_get(self, fields_list): |
||||
|
defaults = super().default_get(fields_list) |
||||
|
start = self.env.context.get('default_datetime_start', False) |
||||
|
table_id = self.env.context.get('default_table_id', False) |
||||
|
if start: |
||||
|
defaults['date'] = start[:10] |
||||
|
dtstart = fields.Datetime.context_timestamp(self, fields.Datetime.to_datetime(start)) |
||||
|
tstart = dtstart.hour |
||||
|
if tstart: |
||||
|
defaults['time_start'] = tstart |
||||
|
if table_id: |
||||
|
defaults['table_ids'] = [(6, 0, [table_id])] |
||||
|
return defaults |
||||
|
|
||||
|
name = fields.Char(string="Name", required=True) |
||||
|
date = fields.Date(string="Date", required=True) |
||||
|
time_start = fields.Float(string="Start", required=True, group_operator=False) |
||||
|
time_stop = fields.Float(string="Stop", compute="_get_time_stop", store=True, inverse="_set_time_stop", |
||||
|
required=True, group_operator=False) |
||||
|
duration = fields.Float(string="Duration", required=True, group_operator=False) |
||||
|
datetime_start = fields.Datetime(string="Date start", compute="_get_datetimes", store=True) |
||||
|
datetime_stop = fields.Datetime(string="Date stop", compute="_get_datetimes", store=True) |
||||
|
count = fields.Integer(string="People count", required=True) |
||||
|
available_table_ids = fields.Many2many(comodel_name='restaurant.table', string="Available tables", |
||||
|
column1="booking_id", column2="table_id", relation="booking_available_table_rel", |
||||
|
compute="_get_available_tables") |
||||
|
table_ids = fields.Many2many(comodel_name='restaurant.table', string="Tables", required=True, |
||||
|
column1="booking_id", column2="table_id", relation="booking_table_rel", |
||||
|
domain="[('id', 'in', available_table_ids)]") |
||||
|
table_capacity = fields.Integer(string="Capacity", compute="_get_table_capacity") |
||||
|
table_capacity_ok = fields.Boolean(string="Capacity OK", compute="_check_table_capacity") |
||||
|
table_booking_ids = fields.One2many(comodel_name="restaurant.table_booking", inverse_name="booking_id", |
||||
|
string="Tables bookings", readonly=True) |
||||
|
|
||||
|
@api.depends('time_start', 'duration') |
||||
|
def _get_time_stop(self): |
||||
|
for booking in self: |
||||
|
if booking.time_start and booking.duration: |
||||
|
booking.time_stop = booking.time_start + booking.duration |
||||
|
else: |
||||
|
booking.time_stop = 0.0 |
||||
|
|
||||
|
@api.onchange('time_stop') |
||||
|
def _set_time_stop(self): |
||||
|
for booking in self: |
||||
|
stop = booking.time_stop |
||||
|
if stop: |
||||
|
booking.duration = stop - booking.time_start |
||||
|
|
||||
|
@api.depends('date', 'time_start', 'time_stop') |
||||
|
def _get_datetimes(self): |
||||
|
user_tz = timezone(self.env.user.tz) |
||||
|
for booking in self: |
||||
|
date = booking.date |
||||
|
if date and booking.time_start: |
||||
|
dt_start = user_tz.localize(dtdatetime.combine(date, float2time(booking.time_start))) |
||||
|
booking.datetime_start = dt_start.astimezone(utc).replace(tzinfo=None) |
||||
|
else: |
||||
|
booking.datetime_start = False |
||||
|
if date and booking.time_stop: |
||||
|
dt_stop = user_tz.localize(dtdatetime.combine(date, float2time(booking.time_stop))) |
||||
|
booking.datetime_stop = dt_stop.astimezone(utc).replace(tzinfo=None) |
||||
|
else: |
||||
|
booking.datetime_stop = False |
||||
|
|
||||
|
@api.depends('table_ids') |
||||
|
def _get_table_capacity(self): |
||||
|
for booking in self: |
||||
|
booking.table_capacity = sum(booking.table_ids.mapped('seats')) |
||||
|
|
||||
|
@api.depends('table_capacity', 'count') |
||||
|
def _check_table_capacity(self): |
||||
|
for booking in self: |
||||
|
booking.table_capacity_ok = bool(booking.table_capacity >= booking.count) |
||||
|
|
||||
|
@api.depends('datetime_start', 'datetime_stop', 'table_ids') |
||||
|
def _get_available_tables(self): |
||||
|
Table = self.env['restaurant.table'] |
||||
|
TableBooking = self.env['restaurant.table_booking'] |
||||
|
for booking in self: |
||||
|
if booking.datetime_start and booking.datetime_stop: |
||||
|
tbookings = TableBooking.search([ |
||||
|
'|', '&', ('datetime_start', '<', booking.datetime_stop), |
||||
|
('datetime_start', '>=', booking.datetime_start), |
||||
|
'&', ('datetime_stop', '>', booking.datetime_start), |
||||
|
('datetime_stop', '<=', booking.datetime_stop) |
||||
|
]) |
||||
|
booking.available_table_ids = Table.search([ |
||||
|
('bookable', '=', True), |
||||
|
('id', 'not in', tbookings.mapped('table_id').ids), |
||||
|
]) - booking.table_ids |
||||
|
else: |
||||
|
booking.available_table_ids = [(5, 0, 0)] |
||||
|
|
||||
|
@api.model_create_multi |
||||
|
def create(self, vals_list): |
||||
|
for vals in vals_list: |
||||
|
vals.update({ |
||||
|
'table_booking_ids': [(0, 0, {'table_id': table_id}) for table_id in vals['table_ids'][0][2]] |
||||
|
}) |
||||
|
res = super().create(vals_list) |
||||
|
return res |
||||
|
|
||||
|
def write(self, vals): |
||||
|
res = super().write(vals) |
||||
|
TableBooking = self.env['restaurant.table_booking'] |
||||
|
to_unlink = TableBooking |
||||
|
for booking in self: |
||||
|
tables = booking.table_ids |
||||
|
table_bookings = booking.table_booking_ids |
||||
|
delete = table_bookings.filtered(lambda rtb: rtb.table_id not in tables) |
||||
|
to_unlink |= delete |
||||
|
to_create = tables - (table_bookings - delete).mapped('table_id') |
||||
|
if to_create: |
||||
|
TableBooking.create([{ |
||||
|
'booking_id': booking.id, |
||||
|
'table_id': table.id, |
||||
|
} for table in to_create]) |
||||
|
if to_unlink: |
||||
|
to_unlink.unlink() |
||||
|
return res |
@ -0,0 +1,14 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from odoo import models, fields |
||||
|
|
||||
|
|
||||
|
class RestaurantTable(models.Model): |
||||
|
_inherit = 'restaurant.table' |
||||
|
|
||||
|
bookable = fields.Boolean(string="Bookable", default=False) |
||||
|
|
||||
|
def name_get(self): |
||||
|
res = [] |
||||
|
for table in self: |
||||
|
res.append((table.id, "{} ({} p.)".format(table.name, table.seats))) |
||||
|
return res |
@ -0,0 +1,17 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from odoo import models, fields |
||||
|
|
||||
|
|
||||
|
class RestaurantTable_booking(models.Model): |
||||
|
_name = 'restaurant.table_booking' |
||||
|
_description = "Resaturant table booking" |
||||
|
_order = 'datetime_start, datetime_stop, table_id' |
||||
|
|
||||
|
booking_id = fields.Many2one(comodel_name='restaurant.booking', string="Booking", required=True, ondelete='cascade') |
||||
|
name = fields.Char(related='booking_id.name', store=True) |
||||
|
count = fields.Integer(related='booking_id.count', store=True) |
||||
|
datetime_start = fields.Datetime(related='booking_id.datetime_start', store=True) |
||||
|
datetime_stop = fields.Datetime(related='booking_id.datetime_stop', store=True) |
||||
|
duration = fields.Float(related='booking_id.duration') |
||||
|
table_id = fields.Many2one(comodel_name='restaurant.table', string="Table", required=True) |
||||
|
color = fields.Char(related='table_id.color', store=True) |
@ -0,0 +1,24 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="restaurant_booking_pos_user" model="ir.model.access"> |
||||
|
<field name="name">Booking restaurant.booking PoS user</field> |
||||
|
<field name="model_id" ref="model_restaurant_booking"/> |
||||
|
<field name="group_id" ref="point_of_sale.group_pos_user"/> |
||||
|
<field name="perm_read">1</field> |
||||
|
<field name="perm_write">1</field> |
||||
|
<field name="perm_create">1</field> |
||||
|
<field name="perm_unlink">1</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_table_booking_pos_user" model="ir.model.access"> |
||||
|
<field name="name">Booking restaurant.table_booking PoS user</field> |
||||
|
<field name="model_id" ref="model_restaurant_table_booking"/> |
||||
|
<field name="group_id" ref="point_of_sale.group_pos_user"/> |
||||
|
<field name="perm_read">1</field> |
||||
|
<field name="perm_write">1</field> |
||||
|
<field name="perm_create">1</field> |
||||
|
<field name="perm_unlink">1</field> |
||||
|
</record> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="res_config_settings_form" model="ir.ui.view"> |
||||
|
<field name="name">Booking res.config.settings form</field> |
||||
|
<field name="model">res.config.settings</field> |
||||
|
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//div[@data-key='point_of_sale']/h2[1]" position="before"> |
||||
|
<h2>Bookings</h2> |
||||
|
<div class="row mt16 o_settings_container" name="bookings_setting_container"> |
||||
|
<div class="col-12 col-lg-6 o_setting_box" id="default_duration_setting" title="This duration is applied to any new booking created in the point of sale."> |
||||
|
<div class="o_setting_right_pane"> |
||||
|
<div> |
||||
|
<label for="default_duration"/> |
||||
|
<!-- <div class="text-muted"> |
||||
|
Default sales tax for products |
||||
|
</div> --> |
||||
|
<div class="content-group mt16"> |
||||
|
<field name="default_duration" colspan="4" nolabel="1" widget="float_time" class="oe_inline"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,137 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="restaurant_booking_form" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.booking form</field> |
||||
|
<field name="model">restaurant.booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<sheet> |
||||
|
<div class="oe_title"> |
||||
|
<label for="name" class="oe_edit_only"/> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="date" class="oe_inline"/> |
||||
|
<label for="time_start" string="Times"/> |
||||
|
<div class="o_row"> |
||||
|
<span>from</span> |
||||
|
<field name="time_start" class="oe_inline" widget="float_time"/> |
||||
|
<span>to</span> |
||||
|
<field name="time_stop" class="oe_inline" widget="float_time"/> |
||||
|
</div> |
||||
|
<field name="duration" class="oe_inline" widget="float_time"/> |
||||
|
<field name="datetime_start" invisible="1"/> |
||||
|
<field name="datetime_stop" invisible="1"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="count" class="oe_inline"/> |
||||
|
<field name="available_table_ids" invisible="1"/> |
||||
|
<field name="table_ids" widget="many2many_tags" options="{'no_create':1}" |
||||
|
attrs="{'invisible': ['|',('datetime_start','=',False),('datetime_stop','=',False)]}"/> |
||||
|
<field name="table_capacity" invisible="1"/> |
||||
|
<field name="table_capacity_ok" invisible="1"/> |
||||
|
<div colspan="2" class="alert alert-warning" role="alert" attrs="{'invisible':[('table_capacity_ok','=',True)]}"> |
||||
|
<i icon="fa-exclamation-triangle"/> |
||||
|
<span class="ml8">The total seats of selected tables is lower than the people count.</span> |
||||
|
</div> |
||||
|
</group> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_booking_tree" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.booking tree</field> |
||||
|
<field name="model">restaurant.booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree expand="true"> |
||||
|
<field name="name"/> |
||||
|
<field name="date"/> |
||||
|
<field name="time_start" widget="float_time"/> |
||||
|
<field name="time_stop" widget="float_time"/> |
||||
|
<field name="duration" widget="float_time"/> |
||||
|
<field name="count"/> |
||||
|
<field name="table_ids" widget="many2many_tags"/> |
||||
|
<field name="available_table_ids" invisible="1"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_booking_search" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.booking search</field> |
||||
|
<field name="model">restaurant.booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<search> |
||||
|
<field name="name"/> |
||||
|
<field name="date"/> |
||||
|
<field name="table_ids"/> |
||||
|
<group expand="0" string="Filters"> |
||||
|
<filter name="today" string="Today" domain="[('date','=',context_today().strftime('%Y-%m-%d'))]"/> |
||||
|
<filter name="tomorrow" string="Tomorrow" domain="[('date','=',(context_today() + relativedelta(days=1)).strftime('%Y-%m-%d'))]"/> |
||||
|
<filter name="next_we" string="Next wednesday" domain="[('date','=',(context_today() + relativedelta(weeks=context_today().weekday() >= 3 and 1 or 0, weekday=2)).strftime('%Y-%m-%d'))]"/> |
||||
|
<filter name="next_sa" string="Next saturday" domain="[('date','=',(context_today() + relativedelta(weeks=context_today().weekday() >= 5 and 1 or 0, weekday=5)).strftime('%Y-%m-%d'))]"/> |
||||
|
<filter name="next_su" string="Next sunday" domain="[('date','=',(context_today() + relativedelta(weeks=context_today().weekday() >= 6 and 1 or 0, weekday=6)).strftime('%Y-%m-%d'))]"/> |
||||
|
<separator/> |
||||
|
<filter name="this_week" string="This week" domain="[('date','>=',(context_today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')),('date','<=',(context_today() + relativedelta(weekday=6)).strftime('%Y-%m-%d'))]"/> |
||||
|
<filter name="next_week" string="Next week" domain="[('date','>=',(context_today() + relativedelta(weeks=1, weekday=0)).strftime('%Y-%m-%d')),('date','<=',(context_today() + relativedelta(weeks=1, weekday=6)).strftime('%Y-%m-%d'))]"/> |
||||
|
<separator/> |
||||
|
<filter name="upcoming" string="Upcoming" domain="[('date','>=',context_today().strftime('%Y-%m-%d'))]"/> |
||||
|
</group> |
||||
|
<group expand="0" string="Group By"> |
||||
|
<filter name="by_date" string="Date" domain="[]" context="{'group_by': 'date:day'}"/> |
||||
|
</group> |
||||
|
</search> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_booking_act_window" model="ir.actions.act_window"> |
||||
|
<field name="name">All bookings</field> |
||||
|
<field name="res_model">restaurant.booking</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="context">{'search_default_upcoming':1, 'search_default_this_week':1, 'search_default_by_date':1}</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="o_view_nocontent_smiling_face"> |
||||
|
Schedule a new booking. |
||||
|
</p><p> |
||||
|
To book, you must provide a name, a date, start and stop hours, the people count and one or more tables. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="create_new_booking_act_window" model="ir.actions.act_window"> |
||||
|
<field name="name">New booking</field> |
||||
|
<field name="type">ir.actions.act_window</field> |
||||
|
<field name="res_model">restaurant.booking</field> |
||||
|
<field name="view_id" ref="restaurant_booking_form"/> |
||||
|
<field name="target">new</field> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem |
||||
|
id="restaurant_booking_root_menu" |
||||
|
name="Bookings" |
||||
|
parent="point_of_sale.menu_point_root" |
||||
|
sequence="5" |
||||
|
groups="point_of_sale.group_pos_user"/> |
||||
|
|
||||
|
<menuitem |
||||
|
id="restaurant_new_booking_menu" |
||||
|
name="New booking" |
||||
|
parent="restaurant_booking_root_menu" |
||||
|
action="create_new_booking_act_window" |
||||
|
sequence="10" |
||||
|
groups="point_of_sale.group_pos_user"/> |
||||
|
|
||||
|
<menuitem |
||||
|
id="restaurant_booking_menu" |
||||
|
name="All bookings" |
||||
|
parent="restaurant_booking_root_menu" |
||||
|
action="restaurant_booking_act_window" |
||||
|
sequence="30" |
||||
|
groups="point_of_sale.group_pos_user"/> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,29 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="restaurant_floor_form" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.floor form</field> |
||||
|
<field name="model">restaurant.floor</field> |
||||
|
<field name="inherit_id" ref="pos_restaurant.view_restaurant_floor_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="shape" position="after"> |
||||
|
<field name="bookable" widget="toggle_button"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<!-- <record id="restaurant_floor_tree" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.floor tree</field> |
||||
|
<field name="model">restaurant.floor</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
</field> |
||||
|
</record> --> |
||||
|
|
||||
|
<!-- <record id="restaurant_floor_search" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.floor search</field> |
||||
|
<field name="model">restaurant.floor</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
</field> |
||||
|
</record> --> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,29 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="restaurant_table_form" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table form</field> |
||||
|
<field name="model">restaurant.table</field> |
||||
|
<field name="inherit_id" ref="pos_restaurant.view_restaurant_table_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="seats" position="after"> |
||||
|
<field name="bookable" widget="boolean_toggle"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<!-- <record id="restaurant_table_tree" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table tree</field> |
||||
|
<field name="model">restaurant.table</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
</field> |
||||
|
</record> --> |
||||
|
|
||||
|
<!-- <record id="restaurant_table_search" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table search</field> |
||||
|
<field name="model">restaurant.table</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
</field> |
||||
|
</record> --> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,103 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="restaurant_table_booking_form" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table_booking form</field> |
||||
|
<field name="model">restaurant.table_booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form create="0" edit="0" delete="0"> |
||||
|
<sheet> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="booking_id" readonly="1"/> |
||||
|
<field name="table_id" options="{'no_open':1, 'no_create':1}"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="datetime_start"/> |
||||
|
<field name="datetime_stop"/> |
||||
|
<field name="duration"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_table_booking_tree" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table_booking tree</field> |
||||
|
<field name="model">restaurant.table_booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree create="0" edit="0" delete="0"> |
||||
|
<field name="booking_id" options="{'no_create':1}"/> |
||||
|
<field name="table_id" options="{'no_open':1, 'no_create':1}"/> |
||||
|
<field name="datetime_start"/> |
||||
|
<field name="datetime_stop"/> |
||||
|
<field name="duration"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_table_booking_gantt" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table_booking gantt</field> |
||||
|
<field name="model">restaurant.table_booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<gantt string="Tables bookings" date_start="datetime_start" date_stop="datetime_stop" scales="day,week" |
||||
|
default_scale="day" precision="{'day': 'hour:half', 'week': 'day:half'}" default_group_by="table_id" color="color" |
||||
|
create="true" on_create="pos_restaurant_table_booking.create_new_booking_act_window" cell_create="true" edit="false"> |
||||
|
<field name="name"/> |
||||
|
<field name="booking_id"/> |
||||
|
<field name="duration"/> |
||||
|
<field name="count"/> |
||||
|
<templates> |
||||
|
<div t-name="gantt-popover" class="container-fluid"> |
||||
|
<div class="row no-gutters"> |
||||
|
<div class="col"> |
||||
|
<ul class="pl-1 mb-0"> |
||||
|
<li><strong>Start : </strong> <span t-esc="userTimezoneStartDate.format('YYYY-MM-DD hh:mm A')"/></li> |
||||
|
<li><strong>Stop : </strong> <span t-esc="userTimezoneStopDate.format('YYYY-MM-DD hh:mm A')"/></li> |
||||
|
<li><strong>Duration : </strong> <span t-field="record.duration" t-options="{'widget':'float_time'}"/> hours</li> |
||||
|
<li><strong>People count : </strong> <span t-field="record.count"/> pers.</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</templates> |
||||
|
</gantt> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_table_booking_search" model="ir.ui.view"> |
||||
|
<field name="name">Booking restaurant.table_booking search</field> |
||||
|
<field name="model">restaurant.table_booking</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<search> |
||||
|
<field name="name"/> |
||||
|
<field name="table_id"/> |
||||
|
<field name="datetime_start"/> |
||||
|
</search> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="restaurant_table_booking_act_window" model="ir.actions.act_window"> |
||||
|
<field name="name">Tables bookings</field> |
||||
|
<field name="res_model">restaurant.table_booking</field> |
||||
|
<field name="view_mode">gantt,form</field> |
||||
|
<!-- <field name="context">{'search_default_today':1}</field> --> |
||||
|
<!-- <field name="help" type="html"> |
||||
|
<p class="o_view_nocontent_smiling_face"> |
||||
|
Prendre une nouvelle réservation. |
||||
|
</p><p> |
||||
|
Une réservation compreend un nom, une date, des horaires et une ou plusieurs tables. |
||||
|
</p> |
||||
|
</field> --> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem |
||||
|
id="restaurant_table_booking_menu" |
||||
|
name="Tables bookings" |
||||
|
parent="restaurant_booking_root_menu" |
||||
|
action="restaurant_table_booking_act_window" |
||||
|
sequence="20" |
||||
|
groups="point_of_sale.group_pos_user"/> |
||||
|
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue