From 91b906dff8424883b81f7d44856b0de89b712aeb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Iv=C3=A1n=20Todorovich?=
Date: Fri, 26 Jul 2019 10:25:55 +0000
Subject: [PATCH 1/5] IMP Improve configuration page. Allow to disable order
mgmt easily.
---
pos_order_mgmt/README.rst | 20 ++++--
pos_order_mgmt/models/pos_config.py | 15 ++--
pos_order_mgmt/readme/CONFIGURE.rst | 20 ++++--
pos_order_mgmt/static/description/index.html | 16 +++--
.../static/description/order-mgmt-config.png | Bin 0 -> 13968 bytes
pos_order_mgmt/static/src/js/widgets.js | 1 +
pos_order_mgmt/static/src/xml/pos.xml | 2 +-
pos_order_mgmt/views/view_pos_config.xml | 64 +++++++-----------
8 files changed, 72 insertions(+), 66 deletions(-)
create mode 100644 pos_order_mgmt/static/description/order-mgmt-config.png
diff --git a/pos_order_mgmt/README.rst b/pos_order_mgmt/README.rst
index 0432d954..826df053 100644
--- a/pos_order_mgmt/README.rst
+++ b/pos_order_mgmt/README.rst
@@ -37,17 +37,23 @@ reprint past tickets or return them.
Configuration
=============
-To configure this module, you need to:
+To configure this module, you need to go to *Point of Sale > Configuration >
+Point of Sale* and enable *Order Management*
-#. Go to *Point of Sale > Configuration > Point of Sale* and select one of
- them.
-#. 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
+.. image:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-config.png
+
+#. Change *Maximum orders 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
+
+#. Enable *Reprint 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
+
+#. Enable *Return orders* on if you want to be able to return past orders
+ in that PoS.
+
+#. Enable *Duplicate orders* on if you want to be able to return past orders
in that PoS.
Usage
diff --git a/pos_order_mgmt/models/pos_config.py b/pos_order_mgmt/models/pos_config.py
index 19141593..8f53d4be 100644
--- a/pos_order_mgmt/models/pos_config.py
+++ b/pos_order_mgmt/models/pos_config.py
@@ -2,6 +2,7 @@
# Copyright 2018 Tecnativa S.L. - David Vidal
# Copyright 2019 Coop IT Easy SCRLfs
# Pierrick Brun
+# Copyright 2019 Druidoo - Iván Todorovich
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
@@ -10,26 +11,32 @@ from odoo import fields, models
class PosConfig(models.Model):
_inherit = 'pos.config'
+ iface_order_mgmt = fields.Boolean(
+ string='Order Management',
+ help='Allows to manage orders in the frontend',
+ default=True,
+ )
+
iface_reprint_done_order = fields.Boolean(
- string='Reprint Done Orders',
+ string='Reprint Orders',
default=True,
help='Allows to reprint already done orders in the frontend',
)
iface_return_done_order = fields.Boolean(
- string='Return Done Orders',
+ string='Return Orders',
default=True,
help='Allows to return already done orders in the frontend',
)
iface_copy_done_order = fields.Boolean(
- string='Duplicate Done Orders',
+ string='Duplicate Orders',
default=True,
help='Allows to duplicate already done orders in the frontend',
)
iface_load_done_order_max_qty = fields.Integer(
- string='Max. Done Orders Quantity To Load',
+ string='Maximum Orders to load',
default=10,
required=True,
help='Maximum number of orders to load on the PoS at its init. '
diff --git a/pos_order_mgmt/readme/CONFIGURE.rst b/pos_order_mgmt/readme/CONFIGURE.rst
index 971dfdec..4bd22f33 100644
--- a/pos_order_mgmt/readme/CONFIGURE.rst
+++ b/pos_order_mgmt/readme/CONFIGURE.rst
@@ -1,12 +1,18 @@
-To configure this module, you need to:
+To configure this module, you need to go to *Point of Sale > Configuration >
+Point of Sale* and enable *Order Management*
-#. Go to *Point of Sale > Configuration > Point of Sale* and select one of
- them.
-#. 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
+.. image:: ../static/description/order-mgmt-config.png
+
+#. Change *Maximum orders 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
+
+#. Enable *Reprint 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
+
+#. Enable *Return orders* on if you want to be able to return past orders
+ in that PoS.
+
+#. Enable *Duplicate orders* on if you want to be able to return past orders
in that PoS.
diff --git a/pos_order_mgmt/static/description/index.html b/pos_order_mgmt/static/description/index.html
index 81502856..6b339b4a 100644
--- a/pos_order_mgmt/static/description/index.html
+++ b/pos_order_mgmt/static/description/index.html
@@ -388,17 +388,19 @@ reprint past tickets or return them.
To configure this module, you need to go to Point of Sale > Configuration >
+Point of Sale and enable Order Management
+
-
Go to Point of Sale > Configuration > Point of Sale and select one of
-them.
-
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
+
Change Maximum orders 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
+
Enable Reprint 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
+
Enable Return orders on if you want to be able to return past orders
+in that PoS.
+
Enable Duplicate orders on if you want to be able to return past orders
in that PoS.
diff --git a/pos_order_mgmt/static/description/order-mgmt-config.png b/pos_order_mgmt/static/description/order-mgmt-config.png
new file mode 100644
index 0000000000000000000000000000000000000000..5d27647a7cea95e4549ba0784a2af6d1e19ee93e
GIT binary patch
literal 13968
zcmd73WmFu|x-D8raDoJPLV~-yg+K@z+}+(Bnh+omG`K@>cXxLQ-azB-ZjD{`KKH(J
z_B-!g8F!33?vGyGqiU_HHL6#w`OR<6FH})p3LS+A1poka=`RvW000Ai{e6H0``SkO
z^*~;~kR85gIs?Gl-hX^x;u+o&0{{geEg`1jk#@Z7>+#NXh3C