so I'm working on POS I added a custom qr code to the receipt generated but now I'm getting an encoding error because the async function to decode the image is set to time 0 - I want to override that function
the function is
odoo.define('point_of_sale.ReceiptScreen', function (require) {
'use strict';
const { Printer } = require('point_of_sale.Printer');
const { is_email } = require('web.utils');
const { useErrorHandlers } = require('point_of_sale.custom_hooks');
const Registries = require('point_of_sale.Registries');
const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen');
const { useAsyncLockedMethod } = require('point_of_sale.custom_hooks');
const { onMounted, useRef, status } = owl;
const ReceiptScreen = (AbstractReceiptScreen) => {
class ReceiptScreen extends AbstractReceiptScreen {
setup() {
super.setup();
useErrorHandlers();
this.orderReceipt = useRef('order-receipt');
const order = this.currentOrder;
const partner = order.get_partner();
this.orderUiState = order.uiState.ReceiptScreen;
this.orderUiState.inputEmail = this.orderUiState.inputEmail || (partner && partner.email) || '';
this.orderUiState.isSendingEmail = false;
this.is_email = is_email;
onMounted(() => {
setTimeout(async () => {
if (status(this) === "mounted") {
let images = this.orderReceipt.el.getElementsByTagName('img');
for (let image of images) {
await image.decode();
}
await this.handleAutoPrint();
}
}, 0);
});
I want to change it to
await this.handleAutoPrint();
}
}, 1000);
I tried extending the class but the first code runs then mine which should not be the case
but the first code runs then mine which should not be the casewhy would you think that? a time out of0will execute before a time out of1000