[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
This commit is contained in:
Pierre Masereel
2019-10-01 10:02:49 +00:00
parent 72d5761730
commit 69dc97c698
4 changed files with 11 additions and 5 deletions
@@ -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>
@@ -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>
+2 -1
View File
@@ -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;
},
});
@@ -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>