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] account_payment_partner: Don't void the bank on account move if no payment mode #1408

Open
rousseldenis opened this issue Jan 30, 2025 · 5 comments
Labels

Comments

@rousseldenis
Copy link
Contributor

If no payment mode is set on the account move, the partner bank is voided if already filled in.

https://github.com/OCA/bank-payment/pull/1094/files#diff-560b5e454acd270e25223d56b85967eaec36fe9a08eac999124990650aa32f6cR114

I think this assertion is true for computed fields not stored... :

Now that partner_bank_id is a computed field, we shouldn't set its value
to False if the move is not a vendor bill or doesn't have a payment mode.

So, I will do a fix for that

@grindtildeath

@rousseldenis rousseldenis changed the title account_payment_partner: Don't void the bank on account move if no payment mode [16.0] account_payment_partner: Don't void the bank on account move if no payment mode Jan 30, 2025
@rousseldenis
Copy link
Contributor Author

This in order to fix incompatibility with overrides on bank computation on account moves:

https://github.com/OCA/account-invoicing/actions/runs/13049589264/job/36406666815?pr=1736#step:8:211

@jbaudoux
Copy link

It's the occasion to improve the tests to include the refunds:
move_type == "out_invoice"
should be
move_type in ("out_invoice", "in_refund")

same for the other direction

@rousseldenis
Copy link
Contributor Author

@yvaucher

@grindtildeath
Copy link
Contributor

@rousseldenis Answering here for your question on #1183 (comment)

It's been some time since I did #1094 but IIRC the idea was not to set partner_bank_id if we don't have a payment mode.

But I agree if it's set manually, then the computation shouldn't remove it.

@rousseldenis
Copy link
Contributor Author

but IIRC the idea was not to set partner_bank_id if we don't have a payment mode.

The problem is some other modules that don't depend on this would fill in the field.

We can agree that we should not modify the field if no payment mode is not filled in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants