diff --git a/pos_timeout/README.rst b/pos_timeout/README.rst new file mode 100644 index 0000000000..e76bc218d8 --- /dev/null +++ b/pos_timeout/README.rst @@ -0,0 +1,108 @@ +======================= +Point of Sale - timeout +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/13.0/pos_timeout + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-13-0/pos-13-0-pos_timeout + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/184/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of Point of Sale module. + +By default, in Odoo a timeout is set to 30 seconds for the creation of +a PoS order. This threshold is usually sufficient, but in some cases it is not, +mainly if the connection is bad, or if some custom modules add extra +long treatments. + +This module allows to change this default value. + +If the call contains more than one order (after a long disconnection period +for example, or if the previous call raised the timeout) the effective timeout +value applied will be equal to the defined timeout value multiplied by the +number of orders. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +* Go to 'Point Of Sale' / 'Configuration' / 'Point of Sale' and edit your + PoS Config, setting a timeout + +.. figure:: https://raw.githubusercontent.com/OCA/pos/13.0/pos_timeout/static/description/pos_config.png + :alt: PoS Configuration + :width: 800 px + +If not set, the default Odoo timeout will be used. (7.5 seconds in V10.0) + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Sylvain LE GAL (https://twitter.com/legalsylvain) +* Nils Hamerlinck (Trobz) +* Dhara Solanki + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop) + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_timeout/__init__.py b/pos_timeout/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_timeout/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_timeout/__manifest__.py b/pos_timeout/__manifest__.py new file mode 100644 index 0000000000..598d664652 --- /dev/null +++ b/pos_timeout/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright (C) 2017 - Today: GRAP (http://www.grap.coop) +# Copyright (C) 2017 - Today: Akretion (http://www.akretion.com) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Point of Sale - timeout", + "summary": "Set the timeout of the point of sale", + "version": "14.0.1.0.0", + "category": "Sales/Point Of Sale", + "website": "https://github.com/OCA/pos", + "author": "GRAP, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "images": ["static/description/pos_config.png"], + "data": ["views/view_pos_config.xml", "views/templates.xml"], + "qweb": ["static/src/xml/pos_timeout.xml"], + "installable": True, +} diff --git a/pos_timeout/i18n/ca.po b/pos_timeout/i18n/ca.po new file mode 100644 index 0000000000..561831d223 --- /dev/null +++ b/pos_timeout/i18n/ca.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-03-26 19:46+0000\n" +"Last-Translator: eduardgm \n" +"Language-Team: none\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "Fi de temps" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout value multiplied by the number of orders.\n" +msgstr "" +"Defineix el valor del temps d'espera del costat del client per a la creació " +"de comandes de Post des de la interfície d'usuari de POS.\n" +"El valor s'expressa en segons, per a un solo demanat.\n" +"Si no es defineix, s'utilitzarà el valor predeterminat d'Odoo: 30 segons.\n" +"Si la crida conté més d'una ordre (després d'un llarg període de " +"desconnexió, per exemple, o si la crida anterior va generar el temps " +"d'espera),\n" +"el valor de temps d'espera efectiu aplicat serà igual al valor de temps " +"d'espera definit multiplicat pel nombre de comandes.\n" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +msgid "PoS Order(s) Timeout" +msgstr "Fi del Temps de les Comandes del TPV" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuració del TPV" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "Ajustos tècnics" diff --git a/pos_timeout/i18n/es.po b/pos_timeout/i18n/es.po new file mode 100644 index 0000000000..f29147f989 --- /dev/null +++ b/pos_timeout/i18n/es.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +# Translators: +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2021-03-26 19:46+0000\n" +"Last-Translator: eduardgm \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "Fin del tiempo" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS " +"Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period " +"for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout " +"value multiplied by the number of orders.\n" +msgstr "" +"Define el valor del tiempo de espera del lado del cliente para la creación " +"de pedidos de PoS desde la interfaz de usuario de POS.\n" +" El valor se expresa en segundos, para un solo pedido.\n" +" Si no se define, se utilizará el valor predeterminado de Odoo: 30 " +"segundos.\n" +" Si la llamada contiene más de una orden (después de un largo período de " +"desconexión, por ejemplo, o si la llamada anterior generó el tiempo de " +"espera),\n" +" el valor de tiempo de espera efectivo aplicado será igual al valor de " +"tiempo de espera definido multiplicado por el número de pedidos.\n" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +msgid "PoS Order(s) Timeout" +msgstr "Tiempo de espera de pedidos de PoS" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuración TPV" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "Ajustes técnicos" + +#~ msgid "pos.config" +#~ msgstr "pos.config" diff --git a/pos_timeout/i18n/fr.po b/pos_timeout/i18n/fr.po new file mode 100644 index 0000000000..862404d6e0 --- /dev/null +++ b/pos_timeout/i18n/fr.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-20 00:43+0000\n" +"PO-Revision-Date: 2018-01-20 00:43+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS " +"Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period " +"for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout " +"value multiplied by the number of orders.\n" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +#, fuzzy +msgid "PoS Order(s) Timeout" +msgstr "Timeout des commandes" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "" + +#~ msgid "pos.config" +#~ msgstr "pos.config" + +#~ msgid "" +#~ "Define the timeout for the creation of PoS Order in the Front Office UI.\n" +#~ " The value is expressed in seconds.\n" +#~ " If not defined, the default Odoo value will be used (30 seconds)." +#~ msgstr "" +#~ "Définit le timeout pour la création des commandes de vente dans la partie " +#~ "front office du point de vente.\n" +#~ " La valeur est exprimée en secondes.\n" +#~ " Si elle n'est pas définie, la valeur par défaut de Odoo sera utilisée. " +#~ "(30 secondes)." diff --git a/pos_timeout/i18n/hr_HR.po b/pos_timeout/i18n/hr_HR.po new file mode 100644 index 0000000000..d53701c26e --- /dev/null +++ b/pos_timeout/i18n/hr_HR.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +# Translators: +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2018-03-01 02:01+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS " +"Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period " +"for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout " +"value multiplied by the number of orders.\n" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +msgid "PoS Order(s) Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "" + +#~ msgid "pos.config" +#~ msgstr "pos.config" diff --git a/pos_timeout/i18n/it.po b/pos_timeout/i18n/it.po new file mode 100644 index 0000000000..b379558e10 --- /dev/null +++ b/pos_timeout/i18n/it.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +# Translators: +# Francesco Fresta , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2018-03-01 02:01+0000\n" +"Last-Translator: Francesco Fresta , 2018\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS " +"Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period " +"for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout " +"value multiplied by the number of orders.\n" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +#, fuzzy +msgid "PoS Order(s) Timeout" +msgstr "PoS Order Timeout" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "" + +#~ msgid "pos.config" +#~ msgstr "pos.config" diff --git a/pos_timeout/i18n/nl_NL.po b/pos_timeout/i18n/nl_NL.po new file mode 100644 index 0000000000..5e86e72ed8 --- /dev/null +++ b/pos_timeout/i18n/nl_NL.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +# Translators: +# Peter Hageman , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2018-03-01 02:01+0000\n" +"Last-Translator: Peter Hageman , 2018\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS " +"Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period " +"for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout " +"value multiplied by the number of orders.\n" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +msgid "PoS Order(s) Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "" + +#~ msgid "pos.config" +#~ msgstr "pos.config" diff --git a/pos_timeout/i18n/pos_timeout.pot b/pos_timeout/i18n/pos_timeout.pot new file mode 100644 index 0000000000..78d2db77ba --- /dev/null +++ b/pos_timeout/i18n/pos_timeout.pot @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_timeout +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \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_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,help:pos_timeout.field_pos_config__pos_order_timeout +msgid "" +"Defines the value of the client-side timeout for the creation of PoS Order(s) from the POS UI.\n" +" The value is expressed in seconds, for a single order.\n" +" If not defined, the default Odoo value will be used: 30 seconds.\n" +" If the call contains more than one order (after a long disconnection period for example, or if the previous call raised the timeout),\n" +" the effective timeout value applied will be equal to the defined timeout value multiplied by the number of orders.\n" +msgstr "" + +#. module: pos_timeout +#: model:ir.model.fields,field_description:pos_timeout.field_pos_config__pos_order_timeout +msgid "PoS Order(s) Timeout" +msgstr "" + +#. module: pos_timeout +#: model:ir.model,name:pos_timeout.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_timeout +#: model_terms:ir.ui.view,arch_db:pos_timeout.view_pos_config_form +msgid "Technical settings" +msgstr "" diff --git a/pos_timeout/models/__init__.py b/pos_timeout/models/__init__.py new file mode 100644 index 0000000000..db8634ade1 --- /dev/null +++ b/pos_timeout/models/__init__.py @@ -0,0 +1 @@ +from . import pos_config diff --git a/pos_timeout/models/pos_config.py b/pos_timeout/models/pos_config.py new file mode 100644 index 0000000000..a5dee5b44b --- /dev/null +++ b/pos_timeout/models/pos_config.py @@ -0,0 +1,23 @@ +# Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = "pos.config" + + pos_order_timeout = fields.Integer( + string="PoS Order(s) Timeout", + help="Defines the value of the" + " client-side timeout for the creation of PoS Order(s)" + " from the POS UI.\n" + " The value is expressed in seconds, for a single order.\n" + " If not defined, the default Odoo value will be used: 30 seconds.\n" + " If the call contains more than one order" + " (after a long disconnection period for example, or if the previous" + " call raised the timeout),\n the effective timeout value applied will" + " be equal to the defined timeout value multiplied by the number of" + " orders.\n", + ) diff --git a/pos_timeout/readme/CONFIGURE.rst b/pos_timeout/readme/CONFIGURE.rst new file mode 100644 index 0000000000..663a8c6f71 --- /dev/null +++ b/pos_timeout/readme/CONFIGURE.rst @@ -0,0 +1,10 @@ +To configure this module, you need to: + +* Go to 'Point Of Sale' / 'Configuration' / 'Point of Sale' and edit your + PoS Config, setting a timeout + +.. figure:: ../static/description/pos_config.png + :alt: PoS Configuration + :width: 800 px + +If not set, the default Odoo timeout will be used. (7.5 seconds in V10.0) diff --git a/pos_timeout/readme/CONTRIBUTORS.rst b/pos_timeout/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..b7fae71f75 --- /dev/null +++ b/pos_timeout/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Sylvain LE GAL (https://twitter.com/legalsylvain) +* Nils Hamerlinck (Trobz) +* Dhara Solanki diff --git a/pos_timeout/readme/CREDITS.rst b/pos_timeout/readme/CREDITS.rst new file mode 100644 index 0000000000..bc2fc4b5af --- /dev/null +++ b/pos_timeout/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop) diff --git a/pos_timeout/readme/DESCRIPTION.rst b/pos_timeout/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..24aa6e9dfc --- /dev/null +++ b/pos_timeout/readme/DESCRIPTION.rst @@ -0,0 +1,13 @@ +This module extends the functionality of Point of Sale module. + +By default, in Odoo a timeout is set to 30 seconds for the creation of +a PoS order. This threshold is usually sufficient, but in some cases it is not, +mainly if the connection is bad, or if some custom modules add extra +long treatments. + +This module allows to change this default value. + +If the call contains more than one order (after a long disconnection period +for example, or if the previous call raised the timeout) the effective timeout +value applied will be equal to the defined timeout value multiplied by the +number of orders. diff --git a/pos_timeout/static/description/icon.png b/pos_timeout/static/description/icon.png new file mode 100644 index 0000000000..325d72f5b2 Binary files /dev/null and b/pos_timeout/static/description/icon.png differ diff --git a/pos_timeout/static/description/index.html b/pos_timeout/static/description/index.html new file mode 100644 index 0000000000..be7f19bd66 --- /dev/null +++ b/pos_timeout/static/description/index.html @@ -0,0 +1,450 @@ + + + + + + +Point of Sale - timeout + + + +
+

Point of Sale - timeout

+ + +

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runbot

+

This module extends the functionality of Point of Sale module.

+

By default, in Odoo a timeout is set to 30 seconds for the creation of +a PoS order. This threshold is usually sufficient, but in some cases it is not, +mainly if the connection is bad, or if some custom modules add extra +long treatments.

+

This module allows to change this default value.

+

If the call contains more than one order (after a long disconnection period +for example, or if the previous call raised the timeout) the effective timeout +value applied will be equal to the defined timeout value multiplied by the +number of orders.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  • Go to ‘Point Of Sale’ / ‘Configuration’ / ‘Point of Sale’ and edit your +PoS Config, setting a timeout
  • +
+
+PoS Configuration +
+

If not set, the default Odoo timeout will be used. (7.5 seconds in V10.0)

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pos_timeout/static/description/pos_config.png b/pos_timeout/static/description/pos_config.png new file mode 100644 index 0000000000..5ce3efb53c Binary files /dev/null and b/pos_timeout/static/description/pos_config.png differ diff --git a/pos_timeout/static/src/js/pos_timeout.js b/pos_timeout/static/src/js/pos_timeout.js new file mode 100644 index 0000000000..b5685df142 --- /dev/null +++ b/pos_timeout/static/src/js/pos_timeout.js @@ -0,0 +1,27 @@ +/** **************************************************************************** + Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) + @author: Sylvain LE GAL (https://twitter.com/legalsylvain) + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + *****************************************************************************/ + +odoo.define("pos_timeout.models", function (require) { + "use strict"; + var models = require("point_of_sale.models"); + + /** *********************************************************************** + Extend module.PosModel: + Overload _save_to_server to alter the timeout + */ + var PosModelParent = models.PosModel.prototype; + models.PosModel = models.PosModel.extend({ + // eslint-disable-next-line no-unused-vars + _save_to_server: function (orders, options) { + // Get PoS Config Settings + var timeout = this.config.pos_order_timeout; + if (timeout > 0 && orders && orders.length) { + arguments[1].timeout = timeout * 1000 * orders.length; + } + return PosModelParent._save_to_server.apply(this, arguments); + }, + }); +}); diff --git a/pos_timeout/views/templates.xml b/pos_timeout/views/templates.xml new file mode 100644 index 0000000000..4937724679 --- /dev/null +++ b/pos_timeout/views/templates.xml @@ -0,0 +1,11 @@ + + +