[FIX] point_of_sale: pricelist

- Create 2 pricelists A and B. Pricelist B relies on A.
- Make B available in the POS, but not A
- Start a POS session

The user faces a black screen without any information on the error.

We add a simple alert so that the user knowns the source of the problem.

opw-1874397
This commit is contained in:
Nicolas Martinelli
2018-09-05 08:59:16 +02:00
committed by Nicolas Martinelli
parent 31981731ea
commit ea5912fedd
2 changed files with 16 additions and 0 deletions
@@ -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."
@@ -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) {