[FIX] point_of_sale: prevent printing empty page

Before this commit, printing a receipt would result in an additional
empty page being printed. This not only wasted paper but also caused
issues. The problem was related to the notification element on the
print page. By removing this element, the issue has been resolved.

opw-3706233

closes odoo/odoo#152731

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
This commit is contained in:
Pedram (pebr)
2024-02-06 18:49:06 +00:00
parent a302373d3f
commit 7c025b2779
2 changed files with 4 additions and 13 deletions
@@ -18,19 +18,7 @@ export class PrinterService {
this.device = newDevice;
}
printWeb(el) {
this.renderer.whenMounted({
el,
callback: () => {
var orig = document.querySelector(".pos-receipt");
if (orig) {
orig.style.display = "none";
}
window.print();
if (orig) {
orig.style.display = "";
}
},
});
this.renderer.whenMounted({ el, callback: window.print });
return true;
}
async printHtml(el, { webPrintFallback = false } = {}) {
@@ -43,4 +43,7 @@
top: 10px;
left: 10px;
}
.o-main-components-container {
display: none;
}
}