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: Avoiding the singleton error related to _get_reconcile_line() #807

Merged

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Feb 24, 2025

Avoiding the singleton error related to _get_reconcile_line()

Related to #694

Example use case:
 File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 541, in _compute_reconcile_data_info
    record.reconcile_data_info = record._default_reconcile_data(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 698, in _default_reconcile_data
    reconcile_auxiliary_id, lines = self._get_reconcile_line(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 1164, in _get_reconcile_line
    new_vals = super()._get_reconcile_line(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_reconcile_abstract.py", line 49, in _get_reconcile_line
    original_amount = amount = net_amount = line.debit - line.credit
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1154, in __get__
    record.ensure_one()
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5204, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: account.move.line(208, 211, 212)

Please @pedrobaeza and @etobella can you review it?

@Tecnativa TT55221

…_get_reconcile_line()

Example use case:
 File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 541, in _compute_reconcile_data_info
    record.reconcile_data_info = record._default_reconcile_data(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 698, in _default_reconcile_data
    reconcile_auxiliary_id, lines = self._get_reconcile_line(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_bank_statement_line.py", line 1164, in _get_reconcile_line
    new_vals = super()._get_reconcile_line(
  File "/opt/odoo/auto/addons/account_reconcile_oca/models/account_reconcile_abstract.py", line 49, in _get_reconcile_line
    original_amount = amount = net_amount = line.debit - line.credit
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1154, in __get__
    record.ensure_one()
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5204, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: account.move.line(208, 211, 212)

TT55221
@OCA-git-bot
Copy link
Contributor

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

Copy link

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

👍

@pedrobaeza pedrobaeza added this to the 16.0 milestone Feb 24, 2025
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-807-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit a4014e2 into OCA:16.0 Feb 24, 2025
5 of 7 checks passed
@pedrobaeza pedrobaeza deleted the 16.0-fix-account_reconcile_oca-TT55221 branch February 24, 2025 16:12
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