-
-
Notifications
You must be signed in to change notification settings - Fork 584
[UPD] account_banking_pain_base: sepa hybrid mode #1528
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
base: 16.0
Are you sure you want to change the base?
[UPD] account_banking_pain_base: sepa hybrid mode #1528
Conversation
|
So to discuss about the methodology (source: this doc):
What we have implemented now is that when the "enforce hybrid mode" checkbox is checked, it adds TwnNm and Ctry and does not include any AdrLine blocks. Perhaps what's even better is that we always assume hybrid mode and:
|
| if bank_id: | ||
| bank = self.env["res.bank"].browse(bank_id) | ||
| else: | ||
| po_id = self.env.context.get("payment_order_id") |
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.
@ntsirintanis I can't find anywhere where the payment_order_id is passed to the context.
In anycase, self should get you the current payment order.
So bank = po.journal_id.bank_account_id.bank_id should work also.
| ) | ||
| if bank: | ||
| self = self.with_context(export_bank_id=bank.id) | ||
| return super().generate_payment_file() |
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.
@ntsirintanis This is not reached when using the account_banking_sepa_credit_transfer or the account_banking_sepa_direct_debit.
It would be better to inject the bank_id to open2generated() instead.
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.
Note that this is an api.model so self may or may not be an empty recordset
386ff1c to
722010f
Compare
No description provided.