-
-
Notifications
You must be signed in to change notification settings - Fork 526
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][IMP] account_banking_mandate_contact: Show contact mandate account bank in invoice report #1282
Open
carlosdauden
wants to merge
1
commit into
OCA:15.0
Choose a base branch
from
Tecnativa:15.0-IMP-account_banking_mandate_contact-show_contact_account_bank
base: 15.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[15.0][IMP] account_banking_mandate_contact: Show contact mandate account bank in invoice report #1282
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from . import account_move | ||
from . import account_move_line | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2024 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = "account.move" | ||
|
||
def partner_banks_to_show(self): | ||
self.ensure_one() | ||
p_shipping_bank_id = self.partner_shipping_id.valid_mandate_id.partner_bank_id | ||
if ( | ||
p_shipping_bank_id | ||
and not self.partner_bank_id | ||
and self.payment_mode_id.payment_method_id.code == "sepa_direct_debit" | ||
): | ||
return p_shipping_bank_id | ||
return super().partner_banks_to_show() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for decoupling this module from SEPA DD, we should:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, what will happen when a contact has a specific mandate and an invoice is printed where, exceptionally, payment by transfer has been established?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the problem with the existing code?
Establishing a bank mandate at the contact level cannot be too decoupled from SEPA DD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without having installed
account_banking_sepa_direct_debit
, this patch won't work, so that's the coupling.I see that the same coupling is right now on
account_payment_partner
:bank-payment/account_payment_partner/models/account_move.py
Line 154 in 87c513b
and this was highlighted already in this comment: #1219 (comment)
I think it's the duty of the user to configure correctly the payment mode to show or not customer bank accounts. It's not like how they are forced to show it. Users have the control over this.
What do you think about changing this in both parts with a migration script setting to not show the bank account if it's set that way but not
sepa_direct_debit
? Do you want me to do it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, do what you think, I just want the client to see what he expects.