From 1fff199195bd87d2818bd180dc58fd189f2c1f0c Mon Sep 17 00:00:00 2001 From: Pierrick Brun Date: Tue, 26 Mar 2019 11:05:51 +0100 Subject: [PATCH] [IMP] configure reprint and return separately --- pos_order_mgmt/README.rst | 21 +++++++++++-------- pos_order_mgmt/models/pos_config.py | 16 ++++++++++---- pos_order_mgmt/readme/CONFIGURE.rst | 6 ++++-- pos_order_mgmt/readme/CONTRIBUTORS.rst | 1 + pos_order_mgmt/readme/USAGE.rst | 4 ++-- pos_order_mgmt/static/description/index.html | 17 ++++++++------- pos_order_mgmt/static/src/js/widgets.js | 7 +++++-- pos_order_mgmt/static/src/xml/pos.xml | 6 +++--- pos_order_mgmt/views/view_pos_config.xml | 22 +++++++++++++++----- 9 files changed, 66 insertions(+), 34 deletions(-) diff --git a/pos_order_mgmt/README.rst b/pos_order_mgmt/README.rst index da00c2fc..c1d40dc6 100644 --- a/pos_order_mgmt/README.rst +++ b/pos_order_mgmt/README.rst @@ -14,13 +14,13 @@ POS Frontend Orders Management :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/11.0/pos_order_mgmt + :target: https://github.com/OCA/pos/tree/12.0/pos_order_mgmt :alt: OCA/pos .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/pos-11-0/pos-11-0-pos_order_mgmt + :target: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_mgmt :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/11.0 + :target: https://runbot.odoo-community.org/runbot/184/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -41,12 +41,14 @@ To configure this module, you need to: #. Go to *Point of Sale > Configuration > Point of Sale* and select one of them. -#. Set *Load Done Orders* on if you want to be able to load past orders in that - PoS. #. Change *Max Done Orders Quantity To Load* to your desired amount (10 by default). Please note that the more you load, the more it will take to load them in the session opening. You can also set it to 0 and you'll just be able to load them from the order list screen. +#. Set *Reprint Done Orders* on if you want to be able to reprint past orders + in that PoS. +#. Set *Return Done Orders* on if you want to be able to return past orders + in that PoS. Usage ===== @@ -54,13 +56,13 @@ Usage Once the PoS is loaded, you'll find a shopping trolley icon (🛒) in the top bar that grants access to the order list screen. -.. image:: https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-icon.png +.. image:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-icon.png There you can find the number of past orders loaded according to your configuration (see Configuration) as well as the orders you checked out in the current session: -.. image:: https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-list.png +.. image:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-list.png #. You can see their totals as well as their custumers if registered. #. You can reprint their tickets clicking on the printer icon (⎙). @@ -86,7 +88,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -104,6 +106,7 @@ Contributors * David Vidal * Sylvain LE GAL (https://twitter.com/legalsylvain) +* Pierrick Brun Maintainers ~~~~~~~~~~~ @@ -118,6 +121,6 @@ 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. +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_order_mgmt/models/pos_config.py b/pos_order_mgmt/models/pos_config.py index 4e82aa6f..e2196a2b 100644 --- a/pos_order_mgmt/models/pos_config.py +++ b/pos_order_mgmt/models/pos_config.py @@ -1,5 +1,7 @@ # Copyright 2018 GRAP - Sylvain LE GAL # Copyright 2018 Tecnativa S.L. - David Vidal +# Copyright 2019 Coop IT Easy SCRLfs +# Pierrick Brun # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models @@ -8,11 +10,17 @@ from odoo import fields, models class PosConfig(models.Model): _inherit = 'pos.config' - iface_load_done_order = fields.Boolean( - string='Load Done Orders', + iface_reprint_done_order = fields.Boolean( + string='Reprint Done Orders', default=True, - help='Allows to load already done orders in the frontend to operate ' - 'over them, allowing reprint the tickets, return items, etc.', + help='Allows to reprint already done orders in the frontend', + oldname='iface_load_done_order', + ) + iface_return_done_order = fields.Boolean( + string='Return Done Orders', + default=True, + help='Allows to return already done orders in the frontend', + oldname='iface_load_done_order', ) iface_load_done_order_max_qty = fields.Integer( string='Max. Done Orders Quantity To Load', diff --git a/pos_order_mgmt/readme/CONFIGURE.rst b/pos_order_mgmt/readme/CONFIGURE.rst index a62d47bf..971dfdec 100644 --- a/pos_order_mgmt/readme/CONFIGURE.rst +++ b/pos_order_mgmt/readme/CONFIGURE.rst @@ -2,9 +2,11 @@ To configure this module, you need to: #. Go to *Point of Sale > Configuration > Point of Sale* and select one of them. -#. Set *Load Done Orders* on if you want to be able to load past orders in that - PoS. #. Change *Max Done Orders Quantity To Load* to your desired amount (10 by default). Please note that the more you load, the more it will take to load them in the session opening. You can also set it to 0 and you'll just be able to load them from the order list screen. +#. Set *Reprint Done Orders* on if you want to be able to reprint past orders + in that PoS. +#. Set *Return Done Orders* on if you want to be able to return past orders + in that PoS. diff --git a/pos_order_mgmt/readme/CONTRIBUTORS.rst b/pos_order_mgmt/readme/CONTRIBUTORS.rst index 9b6ff1a8..efd51b1e 100644 --- a/pos_order_mgmt/readme/CONTRIBUTORS.rst +++ b/pos_order_mgmt/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * David Vidal * Sylvain LE GAL (https://twitter.com/legalsylvain) +* Pierrick Brun diff --git a/pos_order_mgmt/readme/USAGE.rst b/pos_order_mgmt/readme/USAGE.rst index 5811a79c..5a7fd0a8 100644 --- a/pos_order_mgmt/readme/USAGE.rst +++ b/pos_order_mgmt/readme/USAGE.rst @@ -1,13 +1,13 @@ Once the PoS is loaded, you'll find a shopping trolley icon (🛒) in the top bar that grants access to the order list screen. -.. image:: /pos_order_mgmt/static/description/order-mgmt-icon.png +.. image:: ../static/description/order-mgmt-icon.png There you can find the number of past orders loaded according to your configuration (see Configuration) as well as the orders you checked out in the current session: -.. image:: /pos_order_mgmt/static/description/order-mgmt-list.png +.. image:: ../static/description/order-mgmt-list.png #. You can see their totals as well as their custumers if registered. #. You can reprint their tickets clicking on the printer icon (⎙). diff --git a/pos_order_mgmt/static/description/index.html b/pos_order_mgmt/static/description/index.html index 71120495..92a9765e 100644 --- a/pos_order_mgmt/static/description/index.html +++ b/pos_order_mgmt/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module extends the functionality of the PoS frontend allowing to load already done PoS Orders in order to be able to operate over them, being able to reprint past tickets or return them.

@@ -392,23 +392,25 @@ reprint past tickets or return them.

  1. Go to Point of Sale > Configuration > Point of Sale and select one of them.
  2. -
  3. Set Load Done Orders on if you want to be able to load past orders in that -PoS.
  4. Change Max Done Orders Quantity To Load to your desired amount (10 by default). Please note that the more you load, the more it will take to load them in the session opening. You can also set it to 0 and you’ll just be able to load them from the order list screen.
  5. +
  6. Set Reprint Done Orders on if you want to be able to reprint past orders +in that PoS.
  7. +
  8. Set Return Done Orders on if you want to be able to return past orders +in that PoS.

Usage

Once the PoS is loaded, you’ll find a shopping trolley icon (🛒) in the top bar that grants access to the order list screen.

-https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-icon.png +https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-icon.png

There you can find the number of past orders loaded according to your configuration (see Configuration) as well as the orders you checked out in the current session:

-https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-list.png +https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-list.png
  1. You can see their totals as well as their custumers if registered.
  2. You can reprint their tickets clicking on the printer icon (⎙).
  3. @@ -434,7 +436,7 @@ office part, but not in front office part (implemented in this this module).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.

    +feedback.

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

@@ -451,6 +453,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
@@ -460,7 +463,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

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.

+

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_order_mgmt/static/src/js/widgets.js b/pos_order_mgmt/static/src/js/widgets.js index 369a1799..5080d69b 100644 --- a/pos_order_mgmt/static/src/js/widgets.js +++ b/pos_order_mgmt/static/src/js/widgets.js @@ -63,7 +63,10 @@ odoo.define('pos_order_mgmt.widgets', function (require) { show: function () { var self = this; - var previous_screen = this.pos.get_order().get_screen_data('previous-screen'); + var previous_screen; + if (this.pos.get_order()) { + previous_screen = this.pos.get_order().get_screen_data('previous-screen'); + } if (previous_screen === 'receipt') { this.gui.screen_instances.receipt.click_next(); this.gui.show_screen('orderlist'); @@ -267,7 +270,7 @@ odoo.define('pos_order_mgmt.widgets', function (require) { method: 'load_done_order_for_pos', args: [order_id], }).then(function (order_data) { - self.gui.back(); + self.gui.show_screen('orderlist'); var correct_order_print = true; if (action === 'return') { order_data.return = true; diff --git a/pos_order_mgmt/static/src/xml/pos.xml b/pos_order_mgmt/static/src/xml/pos.xml index f3b7b55c..7d737497 100644 --- a/pos_order_mgmt/static/src/xml/pos.xml +++ b/pos_order_mgmt/static/src/xml/pos.xml @@ -2,7 +2,7 @@ - +
@@ -55,10 +55,10 @@ - + - + diff --git a/pos_order_mgmt/views/view_pos_config.xml b/pos_order_mgmt/views/view_pos_config.xml index f94ac8ad..fd1a35fa 100644 --- a/pos_order_mgmt/views/view_pos_config.xml +++ b/pos_order_mgmt/views/view_pos_config.xml @@ -11,19 +11,31 @@ -
+
- +
-
+
+
+
+ +
+
+
+ attrs="{'invisible': [('iface_reprint_done_order', '=', False), + ('iface_return_done_order', '=', False)]}">