Skip to content
Snippets Groups Projects
Commit 8645e318 authored by Adrian Torres's avatar Adrian Torres Committed by Raphael Collet
Browse files

[FIX] website_sale: do not pollute the environment

Instead of polluting an existing environment, use the method that was
intended for changing the company `with_company` which returns a brand
new environment and leaves the existing one unchanged.
parent 61579342
No related branches found
No related tags found
No related merge requests found
......@@ -427,10 +427,8 @@ class TestWebsitePriceListMultiCompany(TransactionCaseWithUserDemo):
'company_id': self.company2.id,
'website_id': False,
})
self.demo_user.partner_id.property_product_pricelist = self.c1_pl
# Switch env.user company to create ir.property in company2
self.env.user.company_id = self.company2
self.demo_user.partner_id.property_product_pricelist = self.c2_pl
self.demo_user.partner_id.with_company(self.company1.id).property_product_pricelist = self.c1_pl
self.demo_user.partner_id.with_company(self.company2.id).property_product_pricelist = self.c2_pl
# Ensure everything was done correctly
self.assertEqual(self.demo_user.partner_id.with_company(self.company1.id).property_product_pricelist, self.c1_pl)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment