summaryrefslogtreecommitdiff
path: root/addons/website/tools.py
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2019-07-04 13:49:59 +0000
committerRomain Derie <rde@odoo.com>2019-07-04 13:58:23 +0000
commit789aa140b96226718bfecc52ec2fe33273e31d3f (patch)
treef255579ecc4a9e574e2d3b81b93716a400dc3bd0 /addons/website/tools.py
parent1c57d5edcfe75b8b46b5453ba96e815235be68a8 (diff)
[FIX] website, website_sale: correctly set company_id on address
During checkout, the user can create a new billing (only for public user as it will create a 'normal' `res.partner`), a new shipping, edit its billing (that will edit himself) or edit its shipping address. All those cases will go through the exact same methods, public user and logged in user included. This previously led to multiple issues and multiple fixes to correctly set `company_id` and `website_id` on the address (res.partner). See 44372471ef that fixed the `website_id` part. See 3a0f05f33 that fixed the multi-company behavior, but needed 2ba71140 to not modify the company of an already created partner, but was still incomplete as after that fix a logged in user would still have the admin (sudo) company instead of the website one as supposed. This commit will fix that bug and add some tests for all mentionned issues. Related to #28853 as we want to backport the mentionned commit but needed to be fix first. closes odoo/odoo#34596 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/website/tools.py')
-rw-r--r--addons/website/tools.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/website/tools.py b/addons/website/tools.py
index fde1e94651d..e634db9d603 100644
--- a/addons/website/tools.py
+++ b/addons/website/tools.py
@@ -47,6 +47,9 @@ class MockRequest(object):
},
'redirect': werkzeug.utils.redirect,
'session': {
+ 'geoip': {
+ 'country_code': kw.get('country_code'),
+ },
'sale_order_id': kw.get('sale_order_id'),
},
'website': kw.get('website'),