Browse Source

Merge PR #380 into 12.0

Signed-off-by legalsylvain
pull/385/head
OCA-git-bot 5 years ago
parent
commit
867613fe73
  1. 20
      pos_order_mgmt/README.rst
  2. 2
      pos_order_mgmt/__manifest__.py
  3. 51
      pos_order_mgmt/i18n/pos_order_mgmt.pot
  4. 15
      pos_order_mgmt/models/pos_config.py
  5. 20
      pos_order_mgmt/readme/CONFIGURE.rst
  6. 16
      pos_order_mgmt/static/description/index.html
  7. BIN
      pos_order_mgmt/static/description/order-mgmt-config.png
  8. 16
      pos_order_mgmt/static/src/css/pos.css
  9. 1
      pos_order_mgmt/static/src/js/widgets.js
  10. 6
      pos_order_mgmt/static/src/xml/pos.xml
  11. 50
      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 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 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. 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. 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. in that PoS.
Usage Usage

2
pos_order_mgmt/__manifest__.py

@ -5,7 +5,7 @@
{ {
'name': 'POS Frontend Orders Management', 'name': 'POS Frontend Orders Management',
'summary': 'Manage old POS Orders from the frontend', 'summary': 'Manage old POS Orders from the frontend',
'version': '12.0.1.0.2',
'version': '12.0.1.0.3',
'category': 'Point of Sale', 'category': 'Point of Sale',
'author': 'GRAP, ' 'author': 'GRAP, '
'Tecnativa, ' 'Tecnativa, '

51
pos_order_mgmt/i18n/pos_order_mgmt.pot

@ -14,23 +14,18 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Allow to duplicate done orders in this POS"
msgstr ""
#. module: pos_order_mgmt
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Allow to reprint done orders in this POS"
#: model:ir.model.fields,help:pos_order_mgmt.field_pos_config__iface_copy_done_order
msgid "Allows to duplicate already done orders in the frontend"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form #: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Allow to return done orders in this POS"
msgid "Allows to manage already done orders in the frontend."
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model:ir.model.fields,help:pos_order_mgmt.field_pos_config__iface_copy_done_order
msgid "Allows to duplicate already done orders in the frontend"
#: model:ir.model.fields,help:pos_order_mgmt.field_pos_config__iface_order_mgmt
msgid "Allows to manage orders in the frontend"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
@ -47,7 +42,7 @@ msgstr ""
#. openerp-web #. openerp-web
#: code:addons/pos_order_mgmt/static/src/xml/pos.xml:36 #: code:addons/pos_order_mgmt/static/src/xml/pos.xml:36
#, python-format #, python-format
msgid "Amount Total"
msgid "Amount"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
@ -59,16 +54,16 @@ msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#. openerp-web #. openerp-web
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:352
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:407
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:353
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:408
#, python-format #, python-format
msgid "Can not execute this action because the POS is currently offline" msgid "Can not execute this action because the POS is currently offline"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#. openerp-web #. openerp-web
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:351
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:406
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:352
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:407
#, python-format #, python-format
msgid "Connection error" msgid "Connection error"
msgstr "" msgstr ""
@ -111,18 +106,12 @@ msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_copy_done_order #: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_copy_done_order
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Duplicate Done Orders"
msgstr ""
#. module: pos_order_mgmt
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Load Done Order Max Qty."
msgid "Duplicate Orders"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_load_done_order_max_qty #: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_load_done_order_max_qty
msgid "Max. Done Orders Quantity To Load"
msgid "Maximum Orders to load"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
@ -131,8 +120,8 @@ msgid "Maximum number of orders to load on the PoS at its init. Set it to 0 to l
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Maximum number orders to load"
#: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_order_mgmt
msgid "Order Management"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
@ -173,7 +162,7 @@ msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#. openerp-web #. openerp-web
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:253
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:254
#, python-format #, python-format
msgid "Refund " msgid "Refund "
msgstr "" msgstr ""
@ -195,14 +184,12 @@ msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_reprint_done_order #: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_reprint_done_order
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Reprint Done Orders"
msgid "Reprint Orders"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_return_done_order #: model:ir.model.fields,field_description:pos_order_mgmt.field_pos_config__iface_return_done_order
#: model_terms:ir.ui.view,arch_db:pos_order_mgmt.view_pos_config_form
msgid "Return Done Orders"
msgid "Return Orders"
msgstr "" msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
@ -226,7 +213,7 @@ msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#. openerp-web #. openerp-web
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:369
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:370
#, python-format #, python-format
msgid "Unable to load some order lines because the products are not available in the POS cache.\n" msgid "Unable to load some order lines because the products are not available in the POS cache.\n"
"\n" "\n"
@ -237,7 +224,7 @@ msgstr ""
#. module: pos_order_mgmt #. module: pos_order_mgmt
#. openerp-web #. openerp-web
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:368
#: code:addons/pos_order_mgmt/static/src/js/widgets.js:369
#, python-format #, python-format
msgid "Unknown Products" msgid "Unknown Products"
msgstr "" msgstr ""

15
pos_order_mgmt/models/pos_config.py

@ -2,6 +2,7 @@
# Copyright 2018 Tecnativa S.L. - David Vidal # Copyright 2018 Tecnativa S.L. - David Vidal
# Copyright 2019 Coop IT Easy SCRLfs # Copyright 2019 Coop IT Easy SCRLfs
# Pierrick Brun <pierrick.brun@akretion.com> # 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). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models from odoo import fields, models
@ -10,26 +11,32 @@ from odoo import fields, models
class PosConfig(models.Model): class PosConfig(models.Model):
_inherit = 'pos.config' _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( iface_reprint_done_order = fields.Boolean(
string='Reprint Done Orders',
string='Reprint Orders',
default=True, default=True,
help='Allows to reprint already done orders in the frontend', help='Allows to reprint already done orders in the frontend',
) )
iface_return_done_order = fields.Boolean( iface_return_done_order = fields.Boolean(
string='Return Done Orders',
string='Return Orders',
default=True, default=True,
help='Allows to return already done orders in the frontend', help='Allows to return already done orders in the frontend',
) )
iface_copy_done_order = fields.Boolean( iface_copy_done_order = fields.Boolean(
string='Duplicate Done Orders',
string='Duplicate Orders',
default=True, default=True,
help='Allows to duplicate already done orders in the frontend', help='Allows to duplicate already done orders in the frontend',
) )
iface_load_done_order_max_qty = fields.Integer( iface_load_done_order_max_qty = fields.Integer(
string='Max. Done Orders Quantity To Load',
string='Maximum Orders to load',
default=10, default=10,
required=True, required=True,
help='Maximum number of orders to load on the PoS at its init. ' 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 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. 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. 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. in that PoS.

16
pos_order_mgmt/static/description/index.html

@ -388,17 +388,19 @@ reprint past tickets or return them.</p>
</div> </div>
<div class="section" id="configuration"> <div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1> <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"> <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 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> 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> 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> in that PoS.</li>
</ol> </ol>
</div> </div>

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

After

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

16
pos_order_mgmt/static/src/css/pos.css

@ -1,4 +1,5 @@
/* Copyright 2018 Tecnativa - David Vidal /* Copyright 2018 Tecnativa - David Vidal
Copyright 2019 Druidoo - Iván Todorovich
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
*/ */
@ -6,7 +7,7 @@
font-size: 20px; font-size: 20px;
} }
.order-line .button {
.orderlist-screen .order-line .button {
cursor: pointer; cursor: pointer;
top: 0px; top: 0px;
line-height: 32px; line-height: 32px;
@ -19,13 +20,13 @@
transition: all 150ms linear; transition: all 150ms linear;
} }
.order-line .button:active {
.orderlist-screen .order-line .button:active {
background: black; background: black;
border-color: black; border-color: black;
color: white; color: white;
} }
.order-returned-warning {
.orderlist-screen .order-returned-warning {
font-size: 16px; font-size: 16px;
font-style: italic; font-style: italic;
padding: 8px 0; padding: 8px 0;
@ -33,3 +34,12 @@
color: white; color: white;
text-align: center; text-align: center;
} }
.orderlist-screen table td[name='td_ol_amount_total'] {
text-align: right;
}
/* Keep the table from breaking when the customer name is too long */
.orderlist-screen table td:not([name='td_ol_customer']) {
white-space: nowrap;
}

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

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

6
pos_order_mgmt/static/src/xml/pos.xml

@ -2,7 +2,7 @@
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-name="ListOrderButtonWidget"> <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"> <div class="header-button order-list-button">
<i class='fa fa-fw fa-shopping-cart'/> <i class='fa fa-fw fa-shopping-cart'/>
</div> </div>
@ -10,7 +10,7 @@
</t> </t>
<t t-name="OrderListScreenWidget"> <t t-name="OrderListScreenWidget">
<div class="clientlist-screen screen">
<div class="orderlist-screen clientlist-screen screen">
<div class="screen-content"> <div class="screen-content">
<section class="top-content"> <section class="top-content">
<span class='button back'> <span class='button back'>
@ -33,7 +33,7 @@
<th name="th_ol_ref">Ref.</th> <th name="th_ol_ref">Ref.</th>
<th name="th_ol_customer">Customer</th> <th name="th_ol_customer">Customer</th>
<th name="th_ol_date">Date</th> <th name="th_ol_date">Date</th>
<th name="th_ol_amount_total">Amount Total</th>
<th name="th_ol_amount_total">Amount</th>
<th name="th_ol_reprint"/> <th name="th_ol_reprint"/>
</thead> </thead>
<tbody class="order-list-contents"> <tbody class="order-list-contents">

50
pos_order_mgmt/views/view_pos_config.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018 GRAP - Sylvain LE GAL <!-- Copyright 2018 GRAP - Sylvain LE GAL
Copyright 2018 Tecnativa - David Vidal Copyright 2018 Tecnativa - David Vidal
Copyright 2019 Druidoo - Iván Todorovich
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
--> -->
<odoo> <odoo>
@ -9,54 +10,37 @@
<field name="model">pos.config</field> <field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/> <field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml"> <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"> <div class="o_setting_left_pane">
<field name="iface_reprint_done_order"/>
<field name="iface_order_mgmt"/>
</div> </div>
<div class="o_setting_right_pane"> <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"> <div class="text-muted">
Allow to reprint done orders in this POS
</div>
Allows to manage already done orders in the frontend.
</div> </div>
<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>
<div class="col-xs-12 col-md-6 o_setting_box" id="return_done_order">
<div class="o_setting_left_pane">
<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"/> <field name="iface_return_done_order"/>
</div> </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">
<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"/> <field name="iface_copy_done_order"/>
</div> </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 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 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>
<div class="content-group mt16">
<field name="iface_load_done_order_max_qty" class="oe_inline"/>
</div> </div>
</div> </div>
</div> </div>
</xpath>
</field> </field>
</record> </record>

Loading…
Cancel
Save