diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index 99621fb1a13..dad53ddda14 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -412,6 +412,13 @@ msgstr "" msgid "Amount total" msgstr "" +#. module: point_of_sale +#. openerp-web +#: code:addons/point_of_sale/static/src/js/models.js:1244 +#, python-format +msgid "An error occurred when loading product prices. Make sure all pricelists are available in the POS." +msgstr "" + #. module: point_of_sale #: model:ir.model.fields,help:point_of_sale.field_pos_config_name msgid "An internal identification of the point of sale." diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 02d8725953c..185e41332a5 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1237,6 +1237,15 @@ exports.Product = Backbone.Model.extend({ var self = this; var date = moment().startOf('day'); + // In case of nested pricelists, it is necessary that all pricelists are made available in + // the POS. Display a basic alert to the user in this case. + if (pricelist === undefined) { + alert(_t( + 'An error occurred when loading product prices. ' + + 'Make sure all pricelists are available in the POS.' + )); + } + var category_ids = []; var category = this.categ; while (category) {