summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren Van Onder <jov@odoo.com>2016-06-01 09:58:47 +0200
committerJoren Van Onder <jov@odoo.com>2016-06-01 09:58:47 +0200
commitdffd4d51f3503987e026ca0edf6a5e4c9a10d192 (patch)
tree7cdf3524c276852bb7d7833dff8ca0b70f02d18f
parent9499b5d4d2481f79226ddbcf1e66176ce216b6fc (diff)
[FIX] point_of_sale: hide QWeb header/footer from non-ESC/POS receipt
We allow users to specify QWeb in the header and footer fields of the receipt. Because the browser receipt and the ESC/POS receipt use a different format (HTML and ESC/POS XML respectively) we don't render this QWeb to both receipts. Currently it is only rendered for the ESC/POS receipt. When this is the case however, we shouldn't display the unrendered QWeb on the regular browser receipt. This commit simply hides it. Perhaps in the future we can provide an additional parameter in the <DOCTYPE declaration that allows the user to specify whether he wants the QWeb to apply to the HTML receipt and/or the ESC/POS receipt. opw-678170
-rw-r--r--addons/point_of_sale/static/src/js/models.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 63ec20399eb..29d9f9f6eb8 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -1422,8 +1422,6 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo
client: client ? client.name : null ,
invoice_id: null, //TODO
cashier: cashier ? cashier.name : null,
- header: this.pos.config.receipt_header || '',
- footer: this.pos.config.receipt_footer || '',
precision: {
price: 2,
money: 2,
@@ -1456,11 +1454,17 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo
};
if (is_xml(this.pos.config.receipt_header)){
+ receipt.header = '';
receipt.header_xml = render_xml(this.pos.config.receipt_header);
+ } else {
+ receipt.header = this.pos.config.receipt_header || '';
}
if (is_xml(this.pos.config.receipt_footer)){
+ receipt.footer = '';
receipt.footer_xml = render_xml(this.pos.config.receipt_footer);
+ } else {
+ receipt.footer = this.pos.config.receipt_footer || '';
}
return receipt;