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

[IMP] Use the partner to find the bank account (for reconciliation) #59

Open
wants to merge 1 commit into
base: 14.0-relax-bank-account-unique-constraint-sbi
Choose a base branch
from

Conversation

apineux
Copy link

@apineux apineux commented Mar 30, 2022

No description provided.

[('company_id', '=', self.company_id.id), ('acc_number', '=', self.account_number)])
[('company_id', '=', self.company_id.id),
('acc_number', '=', self.account_number),
('partner_id', '=', self.partner_id.id)])
Copy link
Member

Choose a reason for hiding this comment

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

Is self.partner_id always known at this stage ? I've not looked in details but I know scenarios (e.g. CODA files import) where the account number is used to find the partner.

Copy link
Author

Choose a reason for hiding this comment

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

Yes the partner_id is always known at this stage.
The only call to that method is this:
if self.account_number and self.partner_id and not self.partner_bank_id: self.partner_bank_id = self._find_or_create_bank_account()

Copy link
Author

Choose a reason for hiding this comment

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

There are maybe other places where Odoo is looking for bank account without using the partner but I only fix the issue on the reconciliation widget provided by Odoo.

@sbidoul
Copy link
Member

sbidoul commented Mar 30, 2022

Note to our future selves: this is necessary when we lift the constraints that allows a bank account to be linked to only one partner.

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.

2 participants