commit 956b3c290f930f6542b67b038e2eb2895712ecb9 Author: Rémi FRANÇOIS Date: Mon Oct 26 15:38:04 2020 +0100 [ADD] pos_restaurant_table_booking module diff --git a/pos_restaurant_table_booking/__init__.py b/pos_restaurant_table_booking/__init__.py new file mode 100644 index 0000000..a0fdc10 --- /dev/null +++ b/pos_restaurant_table_booking/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/pos_restaurant_table_booking/__manifest__.py b/pos_restaurant_table_booking/__manifest__.py new file mode 100644 index 0000000..31f5819 --- /dev/null +++ b/pos_restaurant_table_booking/__manifest__.py @@ -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': '', +} diff --git a/pos_restaurant_table_booking/__pycache__/__init__.cpython-37.pyc b/pos_restaurant_table_booking/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..8063829 Binary files /dev/null and b/pos_restaurant_table_booking/__pycache__/__init__.cpython-37.pyc differ diff --git a/pos_restaurant_table_booking/i18n/fr.po b/pos_restaurant_table_booking/i18n/fr.po new file mode 100644 index 0000000..69f5bcc --- /dev/null +++ b/pos_restaurant_table_booking/i18n/fr.po @@ -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 "" +"\n" +" The total seats of selected tables is lower than the people count." +msgstr "\n" +" Le nombre de places cumulé des tables sélectionnées est inférieur à l'effectif." + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form +msgid "from" +msgstr "de" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form +msgid "to" +msgstr "à" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Duration : " +msgstr "Durée : " + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Start : " +msgstr "Début : " + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "People count : " +msgstr "Effectif : " + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Stop : " +msgstr "Fin : " + +#. 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 "" diff --git a/pos_restaurant_table_booking/i18n/pos_restaurant_table_booking.pot b/pos_restaurant_table_booking/i18n/pos_restaurant_table_booking.pot new file mode 100644 index 0000000..e949699 --- /dev/null +++ b/pos_restaurant_table_booking/i18n/pos_restaurant_table_booking.pot @@ -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 "" +"\n" +" Le nombre de places cumulé des tables sélectionnées est inférieur à l'effectif." +msgstr "" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form +msgid "from" +msgstr "" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_booking_form +msgid "to" +msgstr "" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Durée : " +msgstr "" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Début : " +msgstr "" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Effectif : " +msgstr "" + +#. module: pos_restaurant_table_booking +#: model_terms:ir.ui.view,arch_db:pos_restaurant_table_booking.restaurant_table_booking_gantt +msgid "Fin : " +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 "" diff --git a/pos_restaurant_table_booking/models/__init__.py b/pos_restaurant_table_booking/models/__init__.py new file mode 100644 index 0000000..d523e04 --- /dev/null +++ b/pos_restaurant_table_booking/models/__init__.py @@ -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 diff --git a/pos_restaurant_table_booking/models/__pycache__/__init__.cpython-37.pyc b/pos_restaurant_table_booking/models/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..7a18f96 Binary files /dev/null and b/pos_restaurant_table_booking/models/__pycache__/__init__.cpython-37.pyc differ diff --git a/pos_restaurant_table_booking/models/__pycache__/res_config_settings.cpython-37.pyc b/pos_restaurant_table_booking/models/__pycache__/res_config_settings.cpython-37.pyc new file mode 100644 index 0000000..5c52f3c Binary files /dev/null and b/pos_restaurant_table_booking/models/__pycache__/res_config_settings.cpython-37.pyc differ diff --git a/pos_restaurant_table_booking/models/__pycache__/restaurant_booking.cpython-37.pyc b/pos_restaurant_table_booking/models/__pycache__/restaurant_booking.cpython-37.pyc new file mode 100644 index 0000000..ee18935 Binary files /dev/null and b/pos_restaurant_table_booking/models/__pycache__/restaurant_booking.cpython-37.pyc differ diff --git a/pos_restaurant_table_booking/models/__pycache__/restaurant_table.cpython-37.pyc b/pos_restaurant_table_booking/models/__pycache__/restaurant_table.cpython-37.pyc new file mode 100644 index 0000000..656f24a Binary files /dev/null and b/pos_restaurant_table_booking/models/__pycache__/restaurant_table.cpython-37.pyc differ diff --git a/pos_restaurant_table_booking/models/__pycache__/restaurant_table_booking.cpython-37.pyc b/pos_restaurant_table_booking/models/__pycache__/restaurant_table_booking.cpython-37.pyc new file mode 100644 index 0000000..947a3a2 Binary files /dev/null and b/pos_restaurant_table_booking/models/__pycache__/restaurant_table_booking.cpython-37.pyc differ diff --git a/pos_restaurant_table_booking/models/res_config_settings.py b/pos_restaurant_table_booking/models/res_config_settings.py new file mode 100644 index 0000000..9d5f886 --- /dev/null +++ b/pos_restaurant_table_booking/models/res_config_settings.py @@ -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.") + ] diff --git a/pos_restaurant_table_booking/models/restaurant_booking.py b/pos_restaurant_table_booking/models/restaurant_booking.py new file mode 100644 index 0000000..eb2de61 --- /dev/null +++ b/pos_restaurant_table_booking/models/restaurant_booking.py @@ -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 diff --git a/pos_restaurant_table_booking/models/restaurant_table.py b/pos_restaurant_table_booking/models/restaurant_table.py new file mode 100644 index 0000000..ab2de0d --- /dev/null +++ b/pos_restaurant_table_booking/models/restaurant_table.py @@ -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 diff --git a/pos_restaurant_table_booking/models/restaurant_table_booking.py b/pos_restaurant_table_booking/models/restaurant_table_booking.py new file mode 100644 index 0000000..76caf47 --- /dev/null +++ b/pos_restaurant_table_booking/models/restaurant_table_booking.py @@ -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) diff --git a/pos_restaurant_table_booking/security/ir_model_access.xml b/pos_restaurant_table_booking/security/ir_model_access.xml new file mode 100644 index 0000000..a418436 --- /dev/null +++ b/pos_restaurant_table_booking/security/ir_model_access.xml @@ -0,0 +1,24 @@ + + + + + Booking restaurant.booking PoS user + + + 1 + 1 + 1 + 1 + + + + Booking restaurant.table_booking PoS user + + + 1 + 1 + 1 + 1 + + + diff --git a/pos_restaurant_table_booking/views/res_config_settings.xml b/pos_restaurant_table_booking/views/res_config_settings.xml new file mode 100644 index 0000000..6f997cf --- /dev/null +++ b/pos_restaurant_table_booking/views/res_config_settings.xml @@ -0,0 +1,30 @@ + + + + + Booking res.config.settings form + res.config.settings + + + +

Bookings

+
+
+
+
+
+
+
+
+
+
+
+ +
diff --git a/pos_restaurant_table_booking/views/restaurant_booking.xml b/pos_restaurant_table_booking/views/restaurant_booking.xml new file mode 100644 index 0000000..27d180c --- /dev/null +++ b/pos_restaurant_table_booking/views/restaurant_booking.xml @@ -0,0 +1,137 @@ + + + + + Booking restaurant.booking form + restaurant.booking + +
+ +
+
+ + + + + + + + + + + + + +
+ +
+
+ + + Booking restaurant.booking tree + restaurant.booking + + + + + + + + + + + + + + + + Booking restaurant.booking search + restaurant.booking + + + + + + + + + + + + + + + + + + + + + + + + + + All bookings + restaurant.booking + tree,form + {'search_default_upcoming':1, 'search_default_this_week':1, 'search_default_by_date':1} + +

+ Schedule a new booking. +

+ To book, you must provide a name, a date, start and stop hours, the people count and one or more tables. +

+
+
+ + + New booking + ir.actions.act_window + restaurant.booking + + new + + + + + + + + +
diff --git a/pos_restaurant_table_booking/views/restaurant_floor.xml b/pos_restaurant_table_booking/views/restaurant_floor.xml new file mode 100644 index 0000000..6ba234f --- /dev/null +++ b/pos_restaurant_table_booking/views/restaurant_floor.xml @@ -0,0 +1,29 @@ + + + + + Booking restaurant.floor form + restaurant.floor + + + + + + + + + + + + + diff --git a/pos_restaurant_table_booking/views/restaurant_table.xml b/pos_restaurant_table_booking/views/restaurant_table.xml new file mode 100644 index 0000000..c58a3be --- /dev/null +++ b/pos_restaurant_table_booking/views/restaurant_table.xml @@ -0,0 +1,29 @@ + + + + + Booking restaurant.table form + restaurant.table + + + + + + + + + + + + + diff --git a/pos_restaurant_table_booking/views/restaurant_table_booking.xml b/pos_restaurant_table_booking/views/restaurant_table_booking.xml new file mode 100644 index 0000000..e95c28b --- /dev/null +++ b/pos_restaurant_table_booking/views/restaurant_table_booking.xml @@ -0,0 +1,103 @@ + + + + + Booking restaurant.table_booking form + restaurant.table_booking + +
+ + + + + + + + + + + + + +
+
+
+ + + Booking restaurant.table_booking tree + restaurant.table_booking + + + + + + + + + + + + + Booking restaurant.table_booking gantt + restaurant.table_booking + + + + + + + +
+
+
+
    +
  • Start :
  • +
  • Stop :
  • +
  • Duration : hours
  • +
  • People count : pers.
  • +
+
+
+
+
+
+
+
+ + + Booking restaurant.table_booking search + restaurant.table_booking + + + + + + + + + + + Tables bookings + restaurant.table_booking + gantt,form + + + + + + +