[FIX] pos_restaurant: Fix bill receipt

When bill printing, the order was done instead of just going back to the order.
Now we don't validate the order anymore when showing the printbill receipt screen anymore.

closes odoo/odoo#72142

X-original-commit: 0e8d86238e56d7a248af340e13036444b0e49d4e
Related: odoo/enterprise#19007
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Robin Heinz
2021-07-12 07:49:00 +00:00
committed by Pierre Masereel
parent e7899c2f13
commit 0ddb06b5ec
2 changed files with 7 additions and 1 deletions
@@ -63,6 +63,9 @@ odoo.define('point_of_sale.ReceiptScreen', function (require) {
get nextScreen() {
return { name: 'ProductScreen' };
}
whenClosing() {
this.orderDone();
}
/**
* This function is called outside the rendering call stack. This way,
* we don't block the displaying of ReceiptScreen when it is mounted; additionally,
@@ -72,7 +75,7 @@ odoo.define('point_of_sale.ReceiptScreen', function (require) {
if (this._shouldAutoPrint()) {
await this.printReceipt();
if (this.currentOrder._printed && this._shouldCloseImmediately()) {
this.orderDone();
this.whenClosing();
}
}
}
@@ -10,6 +10,9 @@ odoo.define('pos_restaurant.BillScreen', function (require) {
this.props.resolve({ confirmed: true, payload: null });
this.trigger('close-temp-screen');
}
whenClosing() {
this.confirm();
}
}
BillScreen.template = 'BillScreen';
return BillScreen;