Skip to content
Permalink
Browse files

Fix LocalProxy issue on first load

  • Loading branch information...
tivisse committed Apr 23, 2019
1 parent 28ecef7 commit dae38360e8b371c138af647c29119e0264ed90d9
Showing with 2 additions and 2 deletions.
  1. +2 −2 addons/account/models/chart_template.py
@@ -164,7 +164,7 @@ def try_loading_for_current_company(self):
of accounts had been created for it yet.
"""
self.ensure_one()
if request.session['context'].get('allowed_company_ids'):
if request and request.session['context'].get('allowed_company_ids'):
company_ids = [int(company_id) for company_id in request.session['context'].get('allowed_company_ids').split(',')]
company = self.env['res.company'].browse(company_ids[0])
else:
@@ -182,7 +182,7 @@ def load_for_current_company(self, sale_tax_rate, purchase_tax_rate):
rights.
"""
self.ensure_one()
if request.session['context'].get('allowed_company_ids'):
if request and request.session['context'].get('allowed_company_ids'):
company_ids = [int(company_id) for company_id in request.session['context'].get('allowed_company_ids').split(',')]
company = self.env['res.company'].browse(company_ids[0])
else:

0 comments on commit dae3836

Please sign in to comment.
You can’t perform that action at this time.