diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index 0772e943ce2..0cf10889e07 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -2383,6 +2383,13 @@ msgstr "" msgid "Fiscal Position" msgstr "" +#. module: point_of_sale +#. odoo-javascript +#: code:addons/point_of_sale/static/src/js/Screens/TicketScreen/TicketScreen.js:0 +#, python-format +msgid "Fiscal Position not found" +msgstr "" + #. module: point_of_sale #: model:ir.model.fields,field_description:point_of_sale.field_pos_config__fiscal_position_ids #: model:ir.model.fields,field_description:point_of_sale.field_res_config_settings__pos_fiscal_position_ids @@ -6392,6 +6399,15 @@ msgid "" "The fiscal data module encountered an error while receiving your order." msgstr "" +#. module: point_of_sale +#. odoo-javascript +#: code:addons/point_of_sale/static/src/js/Screens/TicketScreen/TicketScreen.js:0 +#, python-format +msgid "" +"The fiscal position used in the original order is not loaded. Make sure it " +"is loaded by adding it in the pos configuration." +msgstr "" + #. module: point_of_sale #. odoo-python #: code:addons/point_of_sale/models/pos_session.py:0 diff --git a/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js b/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js index ba9c1423f83..6ecac76a537 100644 --- a/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js +++ b/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js @@ -261,6 +261,15 @@ export class TicketScreen extends Component { refundDetail.destinationOrderUid = destinationOrder.uid; } + //Add a check too see if the fiscal position exist in the pos + if (order.fiscal_position_not_found) { + this.showPopup('ErrorPopup', { + title: this.env._t('Fiscal Position not found'), + body: this.env._t('The fiscal position used in the original order is not loaded. Make sure it is loaded by adding it in the pos configuration.') + }); + return; + } + destinationOrder.fiscal_position = order.fiscal_position; // Set the partner to the destinationOrder. this.setPartnerToRefundOrder(partner, destinationOrder); diff --git a/addons/point_of_sale/static/src/app/store/models.js b/addons/point_of_sale/static/src/app/store/models.js index a42442723ad..be1be19e4b8 100644 --- a/addons/point_of_sale/static/src/app/store/models.js +++ b/addons/point_of_sale/static/src/app/store/models.js @@ -1331,7 +1331,8 @@ export class Order extends PosModel { if (fiscal_position) { this.fiscal_position = fiscal_position; } else { - console.error("ERROR: trying to load a fiscal position not available in the pos"); + this.fiscal_position_not_found = true; + console.error('ERROR: trying to load a fiscal position not available in the pos'); } }