[FIX] point_of_sale: error handling
Before, error handling didn't work in point_of_sale when offline. This was due to poor error handling. Now, the "limited functionnalities" popup is displayed correctly. closes odoo/odoo#140037 Related: odoo/enterprise#49705 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
committed by
David Monnom (moda)
parent
ffc001b4c3
commit
569016bf63
@@ -26,7 +26,7 @@ function rpcErrorHandler(env, error, originalError) {
|
||||
registry.category("error_handlers").add("rpcErrorHandler", rpcErrorHandler);
|
||||
|
||||
function offlineErrorHandler(env, error, originalError) {
|
||||
if (error instanceof ConnectionLostError) {
|
||||
if (error instanceof ConnectionLostError || originalError instanceof ConnectionLostError) {
|
||||
env.services.popup.add(OfflineErrorPopup);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,11 @@ export class ReceiptScreen extends Component {
|
||||
// When the order is paid, if there is still a part of the order
|
||||
// to send in preparation it is automatically sent
|
||||
if (this.pos.orderPreparationCategories.size) {
|
||||
await this.pos.sendOrderInPreparation(this.currentOrder);
|
||||
try {
|
||||
await this.pos.sendOrderInPreparation(this.currentOrder);
|
||||
} catch (error) {
|
||||
Promise.reject(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user