diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 35fd4f52a74..adb4919f0e3 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -345,7 +345,8 @@ exports.PosModel = Backbone.Model.extend({ }, },{ model: 'product.product', - fields: ['display_name', 'list_price', 'standard_price', 'categ_id', 'pos_categ_id', 'taxes_id', + // todo remove list_price in master, it is unused + fields: ['display_name', 'list_price', 'lst_price', 'standard_price', 'categ_id', 'pos_categ_id', 'taxes_id', 'barcode', 'default_code', 'to_weight', 'uom_id', 'description_sale', 'description', 'product_tmpl_id','tracking'], order: _.map(['sequence','default_code','name'], function (name) { return {name: name}; }), @@ -1233,7 +1234,7 @@ exports.Product = Backbone.Model.extend({ (! item.date_end || moment(item.date_end).isSameOrAfter(date)); }); - var price = self.list_price; + var price = self.lst_price; _.find(pricelist_items, function (rule) { if (rule.min_quantity && quantity < rule.min_quantity) { return false; diff --git a/addons/point_of_sale/static/src/js/tests.js b/addons/point_of_sale/static/src/js/tests.js index 36fd7a49f8a..6c5c970f545 100644 --- a/addons/point_of_sale/static/src/js/tests.js +++ b/addons/point_of_sale/static/src/js/tests.js @@ -54,6 +54,7 @@ odoo.define('point_of_sale.tour.pricelist', function (require) { var product_limon = posmodel.db.search_product_in_category(0, 'Stringers')[0]; var product_pamplemousse = posmodel.db.search_product_in_category(0, 'Red grapefruit')[0]; var product_grapes = posmodel.db.search_product_in_category(0, 'Black Grapes')[0]; + var product_poire_conference = posmodel.db.search_product_in_category(0, 'Conference pears')[0]; var product_external_audit = posmodel.db.search_product_in_category(0, 'External Audit')[0]; var product_miscellaneous = posmodel.db.search_product_in_category(0, 'Miscellaneous')[0]; @@ -83,6 +84,7 @@ odoo.define('point_of_sale.tour.pricelist', function (require) { .then(compare_backend_frontend(product_miscellaneous, 'Pricelist base', 1, undefined)) .then(compare_backend_frontend(product_miscellaneous, 'Pricelist base 2', 1, undefined)) .then(compare_backend_frontend(product_papillon_orange, 'Pricelist base rounding', 1, undefined)) + .then(compare_backend_frontend(product_poire_conference, 'Public Pricelist', 1, undefined)) .then(function () { $('.pos').addClass('done-testing'); }); diff --git a/addons/point_of_sale/tests/test_frontend.py b/addons/point_of_sale/tests/test_frontend.py index c69381b0344..b3dae4e9350 100644 --- a/addons/point_of_sale/tests/test_frontend.py +++ b/addons/point_of_sale/tests/test_frontend.py @@ -36,6 +36,21 @@ class TestUi(odoo.tests.HttpCase): 'fields_id': field.id, 'value': 'account.account,' + str(account_receivable.id)}) + # test an extra price on an attribute + pear = env.ref('point_of_sale.poire_conference') + attribute_value = env['product.attribute.value'].create({ + 'name': 'add 2', + 'product_ids': [(6, 0, [pear.id])], + 'attribute_id': env['product.attribute'].create({ + 'name': 'add 2', + }).id, + }) + env['product.attribute.price'].create({ + 'product_tmpl_id': pear.product_tmpl_id.id, + 'price_extra': 2, + 'value_id': attribute_value.id, + }) + fixed_pricelist = env['product.pricelist'].create({ 'name': 'Fixed', 'item_ids': [(0, 0, {