Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] account_financial_report: keyError on fin_bal_currency_id #1259

Conversation

TheerayutEncoder
Copy link

keyError: 'fin_bal_currency_id

So I use get() method for skip this error if there is no fin_bal_currency_id key on dict object.

  File "/opt/odoo/auto/addons/report_xlsx/controllers/main.py", line 77, in report_download
    response = self.report_routes(
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 546, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/auto/addons/report_xlsx_helper/controllers/main.py", line 50, in report_routes
    return super().report_routes(reportname, docids, converter, **data)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 546, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/auto/addons/report_xlsx/controllers/main.py", line 37, in report_routes
    xlsx = report.with_context(**context)._render_xlsx(docids, data=data)[0]
  File "/opt/odoo/auto/addons/account_financial_report/models/ir_actions_report.py", line 25, in _render_xlsx
    return super(IrActionsReport, obj)._render_xlsx(docids, data)
  File "/opt/odoo/auto/addons/report_xlsx_helper/models/ir_actions_report.py", line 19, in _render_xlsx
    return super()._render_xlsx(docids, data)
  File "/opt/odoo/auto/addons/report_xlsx/models/ir_report.py", line 22, in _render_xlsx
    report_model.with_context(active_model=self.model)
  File "/opt/odoo/auto/addons/report_xlsx/report/report_abstract_xlsx.py", line 105, in create_xlsx_report
    self.generate_xlsx_report(workbook, data, objs)
  File "/opt/odoo/auto/addons/account_financial_report/report/abstract_report_xlsx.py", line 40, in generate_xlsx_report
    self._generate_report_content(workbook, objects, data, report_data)
  File "/opt/odoo/auto/addons/account_financial_report/report/general_ledger_xlsx.py", line 350, in _generate_report_content
    if foreign_currency and account["fin_bal_currency_id"]:
KeyError: 'fin_bal_currency_id'```

@TheerayutEncoder TheerayutEncoder changed the title 15.0 fix account financial report [15.0][FIX] account_financial_report: keyError on fin_bal_currency_id Dec 3, 2024
@pedrobaeza
Copy link
Member

This was fixed in #1256. Have you tried with that update code?

@pedrobaeza pedrobaeza added this to the 15.0 milestone Dec 3, 2024
@TheerayutEncoder
Copy link
Author

This was fixed in #1256. Have you tried with that update code?

Yes, my code is updated but it still got an error when it check on line 350
with this condition if foreign_currency and account["fin_bal_currency_id"]:

@pedrobaeza
Copy link
Member

Your commit history seems incorrect.

@yajo
Copy link
Member

yajo commented Dec 3, 2024

I'm getting a similar error in v16, but the fix I think won't match.

@yajo
Copy link
Member

yajo commented Dec 3, 2024

See #1260 for the v16 fix.

@TheerayutEncoder
Copy link
Author

@yajo I'm not sure, is it about this PR #1255
I'm forget about this issue, I just re open this PR (my team fix this)

@TheerayutEncoder
Copy link
Author

Your commit history seems incorrect.

I just realize this is my mistake, actually I dont pretend to edit on file xml and it come from this PR #1255
Should I squash all of this commit into 1 commit?

I need your suggestions.
Thanks in advance.

@pedrobaeza
Copy link
Member

@victoralmau can you check?

@victoralmau
Copy link
Member

Fixed #1262

@pedrobaeza pedrobaeza closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants