summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2019-09-19 11:22:32 +0000
committerAntoine Prieels <anp@odoo.com>2019-09-19 11:29:46 +0000
commite8f041ac3dbc393d55c91d4aa407fe64db09441a (patch)
tree03f9a6c54c7bf4fb9099478189e9c6977fbcf1c3
parentd8a2cf04bd97ad08f798c59a1be9ffd7777f3551 (diff)
[FIX] point_of_sale: Black background receipts
Some receipts still had part of their backgrounds black.
-rw-r--r--addons/point_of_sale/static/src/css/pos_receipts.css2
-rw-r--r--addons/point_of_sale/static/src/js/printers.js16
-rw-r--r--addons/point_of_sale/static/src/xml/pos.xml2
3 files changed, 3 insertions, 17 deletions
diff --git a/addons/point_of_sale/static/src/css/pos_receipts.css b/addons/point_of_sale/static/src/css/pos_receipts.css
index dbb94517ae6..ad064c3d091 100644
--- a/addons/point_of_sale/static/src/css/pos_receipts.css
+++ b/addons/point_of_sale/static/src/css/pos_receipts.css
@@ -1,6 +1,4 @@
.pos-receipt-print {
- /*The receipt must be in the top left corner when rendered by html2canvas*/
- margin: -8px;
width: 512px;
text-align: left;
direction: ltr;
diff --git a/addons/point_of_sale/static/src/js/printers.js b/addons/point_of_sale/static/src/js/printers.js
index 1b322697285..3ceeb97ed89 100644
--- a/addons/point_of_sale/static/src/js/printers.js
+++ b/addons/point_of_sale/static/src/js/printers.js
@@ -46,23 +46,11 @@ var PrinterMixin = {
*/
htmlToImg: function (receipt) {
var self = this;
- $('.pos-receipts').html(receipt);
- $('.pos-receipts>.pos-receipt').addClass('pos-receipt-print');
+ $('.pos-receipt-print').html(receipt);
var promise = new Promise(function (resolve, reject) {
html2canvas($('.pos-receipt-print')[0], {
- background :'#FFFFFF',
- height: $('.pos-receipt-print').outerHeight(),
- ignoreElements: function (node) {
- // By default, html2canvas copies the whole DOM even if we just capture a part
- // of it. When copying the list of products, it gets all of the product from the
- // backend. We ignore the content of <div class="pos"> to speed things up.
- if (node.className == "pos") {
- return true;
- }
- return false;
- },
onrendered: function (canvas) {
- $('.pos-receipts').empty();
+ $('.pos-receipt-print').empty();
resolve(self.process_canvas(canvas));
}
})
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index aed72db01be..d693c3f15cb 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -2,7 +2,7 @@
<templates id="template" xml:space="preserve">
<t t-name="Chrome">
- <div class='pos-receipts'>
+ <div class='pos-receipt-print'>
<!-- here go the receipts that will be printed -->
</div>