From 840c3be7b5b960d9aa67d6521905e8606d2504f8 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 14 Feb 2018 15:04:12 +0100 Subject: [PATCH] [FIX] point_of_sale: display python except message on partner creation Having base_vat installed (but is potentially more general than this) In the pos frontend, try to save a partner with an incorrect VAT Before this commit, the generic and cryptic message "your internet is probably down" was displayed to the user when a python exception occured After this commit, we display the exception's message OPW 807656 --- addons/point_of_sale/static/src/js/screens.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 140675e0b16..8b28025a2c7 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1177,9 +1177,14 @@ var ClientListScreenWidget = ScreenWidget.extend({ self.saved_client_details(partner_id); },function(err,event){ event.preventDefault(); + var error_body = _t('Your Internet connection is probably down.'); + if (err.data) { + var except = err.data; + error_body = except.arguments && except.arguments[0] || except.message || error_body; + } self.gui.show_popup('error',{ 'title': _t('Error: Could not Save Changes'), - 'body': _t('Your Internet connection is probably down.'), + 'body': error_body, }); }); },