diff --git a/pos_timeout/README.rst b/pos_timeout/README.rst index 1151af63..04e2aca5 100644 --- a/pos_timeout/README.rst +++ b/pos_timeout/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ======================= 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/10.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-10-0/pos-10-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/10.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 7.5 seconds for the creation of @@ -15,6 +34,15 @@ 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 ============= @@ -24,53 +52,56 @@ 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:: /pos_timeout/static/description/pos_config.png +.. figure:: https://raw.githubusercontent.com/OCA/pos/10.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) -Usage -===== - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/121/10.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 smash it by providing detailed and welcomed feedback. +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) -Funders -------- +Other credits +~~~~~~~~~~~~~ The development of this module has been financially supported by: * GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop) -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +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/models/pos_config.py b/pos_timeout/models/pos_config.py index b7ff8c73..dba806ba 100644 --- a/pos_timeout/models/pos_config.py +++ b/pos_timeout/models/pos_config.py @@ -10,7 +10,13 @@ class PosConfig(models.Model): _inherit = 'pos.config' pos_order_timeout = fields.Integer( - string='PoS Order Timeout', help="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 (7.5 seconds).") + 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: 7.5 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 00000000..663a8c6f --- /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 00000000..6e179015 --- /dev/null +++ b/pos_timeout/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Sylvain LE GAL (https://twitter.com/legalsylvain) +* Nils Hamerlinck (Trobz) diff --git a/pos_timeout/readme/CREDITS.rst b/pos_timeout/readme/CREDITS.rst new file mode 100644 index 00000000..bc2fc4b5 --- /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 00000000..c5058818 --- /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 7.5 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/index.html b/pos_timeout/static/description/index.html new file mode 100644 index 00000000..042807b4 --- /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 7.5 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/src/js/pos_timeout.js b/pos_timeout/static/src/js/pos_timeout.js index fd8615b9..a1a8787c 100644 --- a/pos_timeout/static/src/js/pos_timeout.js +++ b/pos_timeout/static/src/js/pos_timeout.js @@ -18,8 +18,8 @@ odoo.define('pos_timeout.models', function (require) { _save_to_server: function (orders, options) { // Get PoS Config Settings var timeout = this.config.pos_order_timeout; - if (timeout > 0) { - arguments[1].timeout = timeout * 1000; + if (timeout > 0 && orders && orders.length) { + arguments[1].timeout = timeout * 1000 * orders.length; } return PosModelParent._save_to_server.apply(this, arguments); },