summaryrefslogtreecommitdiff
path: root/addons/account_payment/controllers/payment.py
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2018-09-03 14:17:28 +0200
committerLucas Perais (lpe) <lpe@odoo.com>2018-09-18 11:02:58 +0200
commitbd4b50f75a255155a98949c8c3fe3bd0db3695b6 (patch)
tree0b906ba985a22c8a92ec31c8c6dbbe647167f1da /addons/account_payment/controllers/payment.py
parentf2b8caff07ba41b851ae9d5015e317753f3eb1a1 (diff)
[FIX] account*, sale*, website_event, portal: public user not necessarily in right company
Have the main company (A) with the public user Have an invoice in company B Make a brand new browser access the invoice with the token Before this commit: the token link ended up asking the customer to login, eventhough it wouldn't if the invoice were in company A After this commit: the whole payment with access token flow works as expected. OPW 1879999 closes #26744
Diffstat (limited to 'addons/account_payment/controllers/payment.py')
-rw-r--r--addons/account_payment/controllers/payment.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account_payment/controllers/payment.py b/addons/account_payment/controllers/payment.py
index 5d6ab903cb2..d34d29266c9 100644
--- a/addons/account_payment/controllers/payment.py
+++ b/addons/account_payment/controllers/payment.py
@@ -27,7 +27,7 @@ class PaymentPortal(http.Controller):
except:
return False
- if request.env.user == request.env.ref('base.public_user'):
+ if request.env.user._is_public():
save_token = False # we avoid to create a token for the public user
token = request.env['payment.token'].sudo() # currently no support of payment tokens