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

[16.0][FIX] account_reconcile_oca: KeyError on data #777

Merged

Conversation

thomaspaulb
Copy link
Contributor

I'm not quite sure if this is the proper solution to the below problem:

RPC_ERROR

  File "/home/ubuntu/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 456, in _compute_reconcile_data_info
    record.reconcile_data_info = record._default_reconcile_data(
  File "/home/ubuntu/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 570, in _default_reconcile_data
    self.reconcile_bank_line()
  File "/home/ubuntu/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 595, in reconcile_bank_line
    self._prepare_reconcile_line_data(self.reconcile_data_info["data"])
KeyError: 'data'

@OCA-git-bot
Copy link
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

@thomaspaulb
Copy link
Contributor Author

@victoralmau Looks like this got introduced with #762

@pedrobaeza pedrobaeza added this to the 16.0 milestone Jan 15, 2025
@victoralmau
Copy link
Member

Please, can you indicate the steps to reproduce the error?

@thomaspaulb
Copy link
Contributor Author

@victoralmau It happens in cases where reconcile_data_info is (still) an empty dictionary. Then, the account bank statement line is clicked in the reconciliation widget and you get this error, because the default value is not filled yet but it is already trying to reconcile.

In Odoo Shell I've noticed that it happens already when trying to read such bank statement lines. However on second read of the same record, the error does not happen anymore because at that moment the default is already written and the data key has become filled.

@pedrobaeza
Copy link
Member

But isn't that something that indicates that the problem is that the default should be set from the beginning instead of just silencing/bypassing the error?

@victoralmau
Copy link
Member

I have not found the use case that I can functionally reproduce (important to clarify), but the fix seems to be enough to avoid the error.

@thomaspaulb
Copy link
Contributor Author

If I get time I can try to reproduce in a unit test

Copy link
Contributor

@alexis-via alexis-via left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also had this crash

@alexis-via
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-777-by-alexis-via-bump-minor, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 521a52c. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit caf0d94 into OCA:16.0 Feb 4, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants