Skip to content

Commit

Permalink
[FIX] aeroo_report: get_lang from environment
Browse files Browse the repository at this point in the history
closes #64

X-original-commit: 363afae
Signed-off-by: Bruno Zanotti <bz@adhoc.com.ar>
Signed-off-by: augusto-weiss <awe@adhoc.com.ar>
  • Loading branch information
augusto-weiss committed Apr 20, 2024
1 parent 1d0543d commit 48b4a09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion report_aeroo/report_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from odoo.tools.safe_eval import safe_eval, time as safeval_time
from odoo.modules.module import load_manifest
from odoo.tools.misc import posix_to_ldml
from odoo.tools.misc import get_lang
from odoo.exceptions import MissingError
# for format_datetime
from odoo.tools.misc import DATE_LENGTH
Expand Down Expand Up @@ -347,7 +348,8 @@ def _set_objects(self, model, docids):
lctx = self.env.localcontext
lang = lctx['lang']
objects = None
if self.env.context['lang'] != lang:
env_lang = self.env.user.lang or get_lang(self.env).code
if env_lang != lang:
ctx_copy = dict(self.env.context)
ctx_copy.update(lang=lang)
objects = self.env.get(model).with_context(**ctx_copy).browse(docids)
Expand Down

0 comments on commit 48b4a09

Please sign in to comment.