Browse Source

IMP Improve configuration page. Allow to disable order mgmt easily.

pull/397/head
Iván Todorovich 5 years ago
committed by AmmarOfficewala
parent
commit
7701a2ab07
  1. 20
      pos_order_mgmt/README.rst
  2. 15
      pos_order_mgmt/models/pos_config.py
  3. 20
      pos_order_mgmt/readme/CONFIGURE.rst
  4. 16
      pos_order_mgmt/static/description/index.html
  5. BIN
      pos_order_mgmt/static/description/order-mgmt-config.png
  6. 1
      pos_order_mgmt/static/src/js/widgets.js
  7. 2
      pos_order_mgmt/static/src/xml/pos.xml
  8. 64
      pos_order_mgmt/views/view_pos_config.xml

20
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

15
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 <pierrick.brun@akretion.com>
# 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. '

20
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.

16
pos_order_mgmt/static/description/index.html

@ -388,17 +388,19 @@ reprint past tickets or return them.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>To configure this module, you need to:</p>
<p>To configure this module, you need to go to <em>Point of Sale &gt; Configuration &gt;
Point of Sale</em> and enable <em>Order Management</em></p>
<img alt="https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-config.png" src="https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-config.png" />
<ol class="arabic simple">
<li>Go to <em>Point of Sale &gt; Configuration &gt; Point of Sale</em> and select one of
them.</li>
<li>Change <em>Max Done Orders Quantity To Load</em> to your desired amount (10 by
default). Please note that the more you load, the more it will take to load
<li>Change <em>Maximum orders to load</em> 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.</li>
<li>Set <em>Reprint Done Orders</em> on if you want to be able to reprint past orders
<li>Enable <em>Reprint orders</em> on if you want to be able to reprint past orders
in that PoS.</li>
<li>Set <em>Return Done Orders</em> on if you want to be able to return past orders
<li>Enable <em>Return orders</em> on if you want to be able to return past orders
in that PoS.</li>
<li>Enable <em>Duplicate orders</em> on if you want to be able to return past orders
in that PoS.</li>
</ol>
</div>

BIN
pos_order_mgmt/static/description/order-mgmt-config.png

After

Width: 472  |  Height: 234  |  Size: 14 KiB

1
pos_order_mgmt/static/src/js/widgets.js

@ -2,6 +2,7 @@
Copyright 2018 Tecnativa - David Vidal
Copyright 2019 Druidoo - Ivan Todorovich
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
odoo.define('pos_order_mgmt.widgets', function (require) {
"use strict";

2
pos_order_mgmt/static/src/xml/pos.xml

@ -2,7 +2,7 @@
<templates id="template" xml:space="preserve">
<t t-name="ListOrderButtonWidget">
<t t-if="widget.pos.config.iface_load_done_order_max_qty">
<t t-if="widget.pos.config.iface_order_mgmt">
<div class="header-button order-list-button">
<i class='fa fa-fw fa-shopping-cart'/>
</div>

64
pos_order_mgmt/views/view_pos_config.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018 GRAP - Sylvain LE GAL
Copyright 2018 Tecnativa - David Vidal
Copyright 2019 Druidoo - Iván Todorovich
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
@ -9,54 +10,37 @@
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='receipt']" position="inside">
<div class="col-xs-12 col-md-6 o_setting_box" id="reprint_done_order">
<div id="receipt" position="inside">
<div class="col-xs-12 col-md-6 o_setting_box" id="pos_order_mgmt">
<div class="o_setting_left_pane">
<field name="iface_reprint_done_order"/>
<field name="iface_order_mgmt"/>
</div>
<div class="o_setting_right_pane">
<label string="Reprint Done Orders" for="iface_reprint_done_order"/>
<label for="iface_order_mgmt"/>
<div class="text-muted">
Allow to reprint done orders in this POS
Allows to manage already done orders in the frontend.
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="return_done_order">
<div class="o_setting_left_pane">
<field name="iface_return_done_order"/>
</div>
<div class="o_setting_right_pane">
<label string="Return Done Orders" for="iface_return_done_order"/>
<div class="text-muted">
Allow to return done orders in this POS
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="copy_done_order">
<div class="o_setting_left_pane">
<field name="iface_copy_done_order"/>
</div>
<div class="o_setting_right_pane">
<label string="Duplicate Done Orders" for="iface_copy_done_order"/>
<div class="text-muted">
Allow to duplicate done orders in this POS
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="load_done_order_max_qty"
attrs="{'invisible': [('iface_reprint_done_order', '=', False),
('iface_return_done_order', '=', False)]}">
<div class="o_setting_right_pane">
<label string="Load Done Order Max Qty." for="iface_load_done_order_max_qty"/>
<div class="text-muted">
Maximum number orders to load
</div>
<div class="content-group mt16">
<field name="iface_load_done_order_max_qty" class="oe_inline"/>
<div class="content-group mt16" attrs="{'invisible': [('iface_order_mgmt', '=', False)]}">
<div class="row mt16" id="reprint_done_order">
<label for="iface_reprint_done_order" class="col-lg-3 o_light_label"/>
<field name="iface_reprint_done_order"/>
</div>
<div class="row mt16" id="copy_done_order">
<label for="iface_return_done_order" class="col-lg-3 o_light_label"/>
<field name="iface_return_done_order"/>
</div>
<div class="row mt16" id="return_done_order">
<label for="iface_copy_done_order" class="col-lg-3 o_light_label"/>
<field name="iface_copy_done_order"/>
</div>
<div class="row mt16" id="load_done_order_max_qty">
<label for="iface_load_done_order_max_qty" class="col-lg-3 o_light_label"/>
<field name="iface_load_done_order_max_qty"/>
</div>
</div>
</div>
</div>
</xpath>
</div>
</field>
</record>

Loading…
Cancel
Save