[FIX] point_of_sale: receipt automatic print image fail
There were some issues when auto printing the receipt with images. It could happen that the receipt was printed and the image were not yet visible. To fix this, we make sure the image are rendered on the receipt before we print it. closes odoo/odoo#81579 Ticket-id: 2688238 X-original-commit: 10d47ed2aee17f2a0d0b76c49c623fb3da4d5e30 Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit is contained in:
@@ -27,7 +27,13 @@ odoo.define('point_of_sale.ReceiptScreen', function (require) {
|
||||
// We are doing this because we want the receipt screen to be
|
||||
// displayed regardless of what happen to the handleAutoPrint
|
||||
// call.
|
||||
setTimeout(async () => await this.handleAutoPrint(), 0);
|
||||
setTimeout(async () => {
|
||||
let images = this.orderReceipt.el.getElementsByTagName('img');
|
||||
for(let image of images) {
|
||||
await image.decode();
|
||||
}
|
||||
await this.handleAutoPrint();
|
||||
}, 0);
|
||||
}
|
||||
async onSendEmail() {
|
||||
if (!is_email(this.orderUiState.inputEmail)) {
|
||||
|
||||
Reference in New Issue
Block a user