diff --git a/addons/point_of_sale/tests/test_frontend.py b/addons/point_of_sale/tests/test_frontend.py index b3dae4e9350..6e1feed1066 100644 --- a/addons/point_of_sale/tests/test_frontend.py +++ b/addons/point_of_sale/tests/test_frontend.py @@ -197,6 +197,10 @@ class TestUi(odoo.tests.HttpCase): one_week_from_now = today + timedelta(weeks=1) two_weeks_from_now = today + timedelta(weeks=2) + public_pricelist = env['product.pricelist'].create({ + 'name': 'Public Pricelist', + }) + env['product.pricelist'].create({ 'name': 'Dates', 'item_ids': [(0, 0, { @@ -283,9 +287,19 @@ class TestUi(odoo.tests.HttpCase): 'type': 'cash', 'company_id': main_company.id, 'journal_user': True})], + 'pricelist_id': public_pricelist.id, 'available_pricelist_ids': [(4, pricelist.id) for pricelist in all_pricelists], }) + # Change the default sale pricelist of customers, + # so the js tests can expect deterministically this pricelist when selecting a customer. + field = env['ir.model.fields']._get('res.partner', 'property_product_pricelist') + env['ir.property'].search([ + ('name', '=', 'property_product_pricelist'), + ('fields_id', '=', field.id), + ('res_id', '=', False) + ]).write({'value_reference': 'product.pricelist,%s' % public_pricelist.id}) + # open a session, the /pos/web controller will redirect to it main_pos_config.open_session_cb()