Browse Source

[IMP] configure reprint and return separately

pull/416/head
Pierrick Brun 6 years ago
committed by Roberto Fichera
parent
commit
1fff199195
  1. 21
      pos_order_mgmt/README.rst
  2. 16
      pos_order_mgmt/models/pos_config.py
  3. 6
      pos_order_mgmt/readme/CONFIGURE.rst
  4. 1
      pos_order_mgmt/readme/CONTRIBUTORS.rst
  5. 4
      pos_order_mgmt/readme/USAGE.rst
  6. 17
      pos_order_mgmt/static/description/index.html
  7. 7
      pos_order_mgmt/static/src/js/widgets.js
  8. 6
      pos_order_mgmt/static/src/xml/pos.xml
  9. 22
      pos_order_mgmt/views/view_pos_config.xml

21
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 <https://github.com/OCA/pos/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 <https://github.com/OCA/pos/issues/new?body=module:%20pos_order_mgmt%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_order_mgmt%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@ -104,6 +106,7 @@ Contributors
* David Vidal <david.vidal@tecnativa.com>
* Sylvain LE GAL (https://twitter.com/legalsylvain)
* Pierrick Brun <pierrick.brun@akretion.com>
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 <https://github.com/OCA/pos/tree/11.0/pos_order_mgmt>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/12.0/pos_order_mgmt>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

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

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

1
pos_order_mgmt/readme/CONTRIBUTORS.rst

@ -1,2 +1,3 @@
* David Vidal <david.vidal@tecnativa.com>
* Sylvain LE GAL (https://twitter.com/legalsylvain)
* Pierrick Brun <pierrick.brun@akretion.com>

4
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 (⎙).

17
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. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/pos/tree/11.0/pos_order_mgmt"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/pos-11-0/pos-11-0-pos_order_mgmt"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/184/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/pos/tree/12.0/pos_order_mgmt"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_mgmt"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/184/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>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.</p>
@ -392,23 +392,25 @@ reprint past tickets or return them.</p>
<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>Set <em>Load Done Orders</em> on if you want to be able to load past orders in that
PoS.</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
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
in that PoS.</li>
<li>Set <em>Return Done Orders</em> on if you want to be able to return past orders
in that PoS.</li>
</ol>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
<p>Once the PoS is loaded, you’ll find a shopping trolley icon (🛒) in the top
bar that grants access to the order list screen.</p>
<img alt="https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-icon.png" src="https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-icon.png" />
<img alt="https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-icon.png" src="https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-icon.png" />
<p>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:</p>
<img alt="https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-list.png" src="https://raw.githubusercontent.com/pos_order_mgmt/static/description/order-mgmt-list.png" />
<img alt="https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-list.png" src="https://raw.githubusercontent.com/OCA/pos/12.0/pos_order_mgmt/static/description/order-mgmt-list.png" />
<ol class="arabic simple">
<li>You can see their totals as well as their custumers if registered.</li>
<li>You can reprint their tickets clicking on the printer icon (⎙).</li>
@ -434,7 +436,7 @@ office part, but not in front office part (implemented in this this module).</li
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_order_mgmt%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_order_mgmt%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -451,6 +453,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<ul class="simple">
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li>Sylvain LE GAL (<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>)</li>
<li>Pierrick Brun &lt;<a class="reference external" href="mailto:pierrick.brun&#64;akretion.com">pierrick.brun&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@ -460,7 +463,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/11.0/pos_order_mgmt">OCA/pos</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/12.0/pos_order_mgmt">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

7
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;

6
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">
<t t-if="widget.pos.config.iface_load_done_order_max_qty">
<div class="header-button order-list-button">
<i class='fa fa-fw fa-shopping-cart'/>
</div>
@ -55,10 +55,10 @@
<td name="td_ol_date"><t t-esc='order.date_order' /></td>
<td name="td_ol_amount_total"><t t-esc='widget.format_currency(order.amount_total)' /></td>
<td name="td_ol_reprint" t-att-data-order-id="order.id" t-att-data-Uid='order.uid'>
<span class="button order-list-reprint" t-att-data-order-id="order.id" t-att-data-Uid='order.uid'>
<span t-if="widget.pos.config.iface_reprint_done_order" class="button order-list-reprint" t-att-data-order-id="order.id" t-att-data-Uid='order.uid'>
<i class='fa fa-fw fa-print'/>
</span>
<span t-if="order.amount_total >= 0" class="button order-list-return" t-att-data-order-id="order.id" t-att-data-Uid='order.uid'>
<span t-if="widget.pos.config.iface_return_done_order and order.amount_total >= 0" class="button order-list-return" t-att-data-order-id="order.id" t-att-data-Uid='order.uid'>
<i class='fa fa-fw fa-undo'/>
</span>
</td>

22
pos_order_mgmt/views/view_pos_config.xml

@ -11,19 +11,31 @@
<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="load_done_order">
<div class="col-xs-12 col-md-6 o_setting_box" id="reprint_done_order">
<div class="o_setting_left_pane">
<field name="iface_load_done_order"/>
<field name="iface_reprint_done_order"/>
</div>
<div class="o_setting_right_pane">
<label string="Load Done Orders" for="iface_load_done_order"/>
<label string="Reprint Done Orders" for="iface_reprint_done_order"/>
<div class="text-muted">
Allow to load done orders in this POS
Allow to reprint done orders in this POS
</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="load_done_order_max_qty"
attrs="{'invisible': [('iface_load_done_order', '=', False)]}">
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">

Loading…
Cancel
Save