summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2021-02-03 15:02:29 +0000
committerGoffin Simon <sig@odoo.com>2021-02-03 15:04:37 +0000
commit6b23ff3bdd1d5a3f34a431e2301db5984e0f761a (patch)
treef21e5d3ca7e84c53fe906e7e3faa674bb98cb59c /addons
parente991b30fa1d51add212bc42825027723f13587ab (diff)
[FIX] payment_alipay, payment_paypal: Online payment with public user
Steps to reproduce the bug: 1) Enable Paypal on the Payment Acquirers and select "BE Company CoA" on the company 2) fill the email and enable the "Add Extra Fees" 3) create an invoice on the company "BE Company CoA" 4) preview it as a public user Bug: An access error was raised: Due to security restrictions, you are not allowed to access 'Companies' (res.company) records. opw:2439896 closes odoo/odoo#65460 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/payment_alipay/models/payment.py2
-rw-r--r--addons/payment_paypal/models/payment.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/payment_alipay/models/payment.py b/addons/payment_alipay/models/payment.py
index 4be338cf397..326f0ddcaec 100644
--- a/addons/payment_alipay/models/payment.py
+++ b/addons/payment_alipay/models/payment.py
@@ -57,7 +57,7 @@ class PaymentAcquirer(models.Model):
fees = 0.0
if self.fees_active:
country = self.env['res.country'].browse(country_id)
- if country and self.company_id.country_id.id == country.id:
+ if country and self.company_id.sudo().country_id.id == country.id:
percentage = self.fees_dom_var
fixed = self.fees_dom_fixed
else:
diff --git a/addons/payment_paypal/models/payment.py b/addons/payment_paypal/models/payment.py
index cf0d0df23f8..7cd53a4bc95 100644
--- a/addons/payment_paypal/models/payment.py
+++ b/addons/payment_paypal/models/payment.py
@@ -75,7 +75,7 @@ class AcquirerPaypal(models.Model):
if not self.fees_active:
return 0.0
country = self.env['res.country'].browse(country_id)
- if country and self.company_id.country_id.id == country.id:
+ if country and self.company_id.sudo().country_id.id == country.id:
percentage = self.fees_dom_var
fixed = self.fees_dom_fixed
else: