summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2019-09-16 14:35:57 +0000
committerPierre Masereel <pim@odoo.com>2019-10-01 10:02:49 +0000
commit69dc97c6986dbe363ed8c9cd1934cfd56cee8814 (patch)
treef0069843c84050b921c9a603fbbfbd58dedd4630
parent72d5761730aac2eea461ea81527c8e2350a8a6a5 (diff)
[FIX] point_of_sale, pos_reprint: write duplicata on reprint
When a receipt is reprinted, the word 'DUPLICATA' is printed at the bottom of the receipt. We are also allowing to reprint ticket even if no printer is selected on the POS config as nothing prevent to do this. TASK-ID: 47990
-rw-r--r--addons/point_of_sale/views/pos_config_view.xml2
-rw-r--r--addons/pos_epson_printer/views/pos_config_views.xml3
-rw-r--r--addons/pos_reprint/static/src/js/reprint.js3
-rw-r--r--addons/pos_reprint/static/src/xml/reprint.xml8
4 files changed, 11 insertions, 5 deletions
diff --git a/addons/point_of_sale/views/pos_config_view.xml b/addons/point_of_sale/views/pos_config_view.xml
index a36595211c4..e89869af254 100644
--- a/addons/point_of_sale/views/pos_config_view.xml
+++ b/addons/point_of_sale/views/pos_config_view.xml
@@ -445,7 +445,7 @@
</div>
</div>
</div>
- <div class="col-12 col-lg-6 o_setting_box pos_reprint_receipt" attrs="{'invisible': [('iface_print_via_proxy','=',False)]}">
+ <div class="col-12 col-lg-6 o_setting_box pos_reprint_receipt">
<div class="o_setting_left_pane">
<field name='module_pos_reprint'/>
</div>
diff --git a/addons/pos_epson_printer/views/pos_config_views.xml b/addons/pos_epson_printer/views/pos_config_views.xml
index 1fc547c4a39..3624f6df3bc 100644
--- a/addons/pos_epson_printer/views/pos_config_views.xml
+++ b/addons/pos_epson_printer/views/pos_config_views.xml
@@ -20,9 +20,6 @@
The Epson receipt printer will be used instead of the receipt printer connected to the IoT Box.
</div>
</xpath>
- <xpath expr="//div[hasclass('pos_reprint_receipt')]" position="attributes">
- <attribute name="attrs">{'invisible': [('iface_print_via_proxy','=',False), ('epson_printer_ip', 'in', [False, ''])]}</attribute>
- </xpath>
</field>
</record>
</odoo>
diff --git a/addons/pos_reprint/static/src/js/reprint.js b/addons/pos_reprint/static/src/js/reprint.js
index 24be9d336ec..05cbc028604 100644
--- a/addons/pos_reprint/static/src/js/reprint.js
+++ b/addons/pos_reprint/static/src/js/reprint.js
@@ -23,6 +23,7 @@ var ReprintReceiptScreenWidget = screens.ReceiptScreenWidget.extend({
this.gui.show_screen('products');
},
get_receipt_render_env: function() {
+ this.pos.last_receipt_render_env.receipt.reprint = true;
return this.pos.last_receipt_render_env;
},
});
@@ -46,7 +47,7 @@ screens.define_action_button({
'name': 'reprint',
'widget': ReprintButton,
'condition': function(){
- return this.pos.config.module_pos_reprint && this.pos.proxy.printer;
+ return this.pos.config.module_pos_reprint;
},
});
diff --git a/addons/pos_reprint/static/src/xml/reprint.xml b/addons/pos_reprint/static/src/xml/reprint.xml
index fa782fbd2f7..285c0c6eb6d 100644
--- a/addons/pos_reprint/static/src/xml/reprint.xml
+++ b/addons/pos_reprint/static/src/xml/reprint.xml
@@ -16,4 +16,12 @@
</t>
</t>
+ <t t-extend="OrderReceipt">
+ <t t-jquery='.pos-receipt-order-data' t-operation='append'>
+ <t t-if='receipt.reprint === true'>
+ <div>DUPLICATA</div>
+ </t>
+ </t>
+ </t>
+
</templates>