diff --git a/addons/pos_restaurant/i18n/pos_restaurant.pot b/addons/pos_restaurant/i18n/pos_restaurant.pot index 2786e5b71aad7a707de47779e633dd761b371f32..0572b1fe85ca4a7ccadb707cbdb486da767ad9d0 100644 --- a/addons/pos_restaurant/i18n/pos_restaurant.pot +++ b/addons/pos_restaurant/i18n/pos_restaurant.pot @@ -218,6 +218,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 @@ -286,6 +293,13 @@ msgstr "" msgid "Config Settings" 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 @@ -1387,6 +1401,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 962db9d6545ab1478bec48f5dc4da83b7ca3f59e..0929b23e2dcd11f606150c0296f0e025dcf32056 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().setCustomerCount(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().setCustomerCount(guestCount); } } }