diff --git a/addons/pos_restaurant/i18n/pos_restaurant.pot b/addons/pos_restaurant/i18n/pos_restaurant.pot index b7dcd120ab36365f5294e73f68dc06a0864a0940..626c023ab5993fd696c9c5869ea86a84862bf47e 100644 --- a/addons/pos_restaurant/i18n/pos_restaurant.pot +++ b/addons/pos_restaurant/i18n/pos_restaurant.pot @@ -240,6 +240,13 @@ msgstr "" msgid "Bill Splitting" msgstr "" +#. module: pos_restaurant +#. openerp-web +#: code:addons/pos_restaurant/static/src/js/Screens/ProductScreen/ControlButtons/TableGuestsButton.js:0 +#, python-format +msgid "Blocked action" +msgstr "" + #. module: pos_restaurant #. openerp-web #: code:addons/pos_restaurant/static/src/xml/Screens/FloorScreen/EditBar.xml:0 @@ -303,6 +310,13 @@ msgstr "" msgid "Color" msgstr "" +#. module: pos_restaurant +#. openerp-web +#: code:addons/pos_restaurant/static/src/js/ChromeWidgets/TicketButton.js:0 +#, python-format +msgid "Connection Error" +msgstr "" + #. module: pos_restaurant #: model:ir.model.fields,field_description:pos_restaurant.field_restaurant_floor__create_uid #: model:ir.model.fields,field_description:pos_restaurant.field_restaurant_printer__create_uid @@ -342,6 +356,13 @@ msgstr "" msgid "Drinks" msgstr "" +#. module: pos_restaurant +#. openerp-web +#: code:addons/pos_restaurant/static/src/js/ChromeWidgets/TicketButton.js:0 +#, python-format +msgid "Due to a connection error, the orders are not synchronized." +msgstr "" + #. module: pos_restaurant #. openerp-web #: code:addons/pos_restaurant/static/src/xml/Screens/FloorScreen/EditBar.xml:0 @@ -1023,6 +1044,7 @@ msgstr "" #. module: pos_restaurant #. openerp-web +#: code:addons/pos_restaurant/static/src/js/Screens/TicketScreen.js:0 #: code:addons/pos_restaurant/static/src/xml/Screens/TicketScreen.xml:0 #: code:addons/pos_restaurant/static/src/xml/Screens/TicketScreen.xml:0 #: model:ir.model.fields,field_description:pos_restaurant.field_pos_order__table_id @@ -1324,6 +1346,13 @@ msgstr "" msgid "Yellow" msgstr "" +#. module: pos_restaurant +#. openerp-web +#: code:addons/pos_restaurant/static/src/js/Screens/ProductScreen/ControlButtons/TableGuestsButton.js:0 +#, python-format +msgid "You cannot put a number that exceeds %s " +msgstr "" + #. module: pos_restaurant #: code:addons/pos_restaurant/models/pos_restaurant.py:0 #, python-format diff --git a/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ControlButtons/TableGuestsButton.js b/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ControlButtons/TableGuestsButton.js index 9a0d1aecd9ce8ffd3697a2c94abc30d118aabe81..8d70dcd9e375aaad88b9836c264ecee4c7d8b82e 100644 --- a/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ControlButtons/TableGuestsButton.js +++ b/addons/pos_restaurant/static/src/js/Screens/ProductScreen/ControlButtons/TableGuestsButton.js @@ -26,7 +26,20 @@ odoo.define('pos_restaurant.TableGuestsButton', function(require) { }); if (confirmed) { - this.env.pos.get_order().set_customer_count(parseInt(inputNumber, 10) || 1); + const guestCount = parseInt(inputNumber, 10) || 1; + // Set the maximum number possible for an integer + const max_capacity = 2**31 - 1; + if (guestCount > max_capacity) { + await this.showPopup('ErrorPopup', { + title: this.env._t('Blocked action'), + body: _.str.sprintf( + this.env._t('You cannot put a number that exceeds %s '), + max_capacity, + ), + }); + return; + } + this.env.pos.get_order().set_customer_count(guestCount); } } }