-
-
Notifications
You must be signed in to change notification settings - Fork 536
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][FIX] account_payment_order: Filter bank on company #1237
[15.0][FIX] account_payment_order: Filter bank on company #1237
Conversation
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 understand that the problem is that you have selected more than one company at the same time when preparing the payment order. I think the cleanest patch should be to do self.partner_id.with_context(allowed_company_ids=self.company_id).bank_ids
instead. What do you think?
No, Only one company selected. But this shouldn't depend on access / ir.rule
Didn't know that trick - And it seems to depend on access / ir.rules. i.e won't work in a background job run by the system user |
a3f7726
to
9df2913
Compare
@pedrobaeza Your suggestions has been applied. |
You have modified slightly my suggestions, why? Mine is more compact and descriptive. |
9df2913
to
62c4bc9
Compare
Because I assumed this [:1].id would fail with IndexError: tuple index out of range if the filtered list is empty.... |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
/ocabot merge patch Please fw-port it to upper versions. |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 87a2308. Thanks a lot for contributing to OCA. ❤️ |
In multi company setup, we need to filter res.partner.bank for current (payment order) company, or shared partner bank account (No company set)