From 7a417e1735eefc8bf68c789781a1ccc0812ae67e Mon Sep 17 00:00:00 2001 From: GabbasovDinar Date: Fri, 29 Jun 2018 10:09:57 +0000 Subject: [PATCH] [IMP] point_of_sale: display pricelist button only if enabled If the option use_pricelist is disabled, no need to display the button Closes #25540 --- addons/point_of_sale/static/src/js/screens.js | 2 +- addons/point_of_sale/tests/test_frontend.py | 1 + 2 files changed, 2 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 4e61ec32ce8..ac83d2962b7 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -2232,7 +2232,7 @@ define_action_button({ 'name': 'set_pricelist', 'widget': set_pricelist_button, 'condition': function(){ - return this.pos.pricelists.length > 1; + return this.pos.config.use_pricelist && this.pos.pricelists.length > 1; }, }); diff --git a/addons/point_of_sale/tests/test_frontend.py b/addons/point_of_sale/tests/test_frontend.py index cea15d9e5a6..4cbb3e79996 100644 --- a/addons/point_of_sale/tests/test_frontend.py +++ b/addons/point_of_sale/tests/test_frontend.py @@ -273,6 +273,7 @@ class TestUi(odoo.tests.HttpCase): 'type': 'cash', 'company_id': main_company.id, 'journal_user': True})], + 'use_pricelist': True, 'available_pricelist_ids': [(4, pricelist.id) for pricelist in all_pricelists], })