[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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user