bank-payment icon indicating copy to clipboard operation
bank-payment copied to clipboard

[16.0][FIX] account_payment_order: Keep partner_bank_id correct value on payments belonging to payment order

Open aritzolea opened this issue 2 years ago • 1 comments

Payments (account.payment) belonging to a payment order (account.payment.order) are assigned the partner bank account on their creation which doesn't follow the pattern defined on the _compute_available_partner_bank_ids from the account module.

This is not important while the compute method is not triggered, but if it gets triggered the original partner_bank_id value gets replaced by the value defined in the compute method (journal's bank in case of incoming payment orders). This affects to the creation of sepa files, because the bank accounts listed in the file are not correct.

This fix overrides _compute_available_partner_bank_ids function on account_payment_order module. For payments which belong to a payment order and are generated from payment lines (account.payment.line), it assigns the partner_bank_id from the origin payment lines.

aritzolea avatar Jan 31 '24 14:01 aritzolea

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

OCA-git-bot avatar Feb 05 '24 14:02 OCA-git-bot

This is better fixed IMO here: #1346

Do you have anyway the trigger conditions?

pedrobaeza avatar Sep 13 '24 07:09 pedrobaeza

This is better fixed IMO here: #1346

Do you have anyway the trigger conditions?

A trigger condicion can be seen in the video I recorded for this PR a few months ago

aritzolea avatar Sep 13 '24 07:09 aritzolea

But I wasn't able to reproduce it on the same conditions, @aritzolea. It seems something that depends on the module stack. Did you do it on runboat? Anyway, as said, the other PR is more focused IMO.

pedrobaeza avatar Sep 13 '24 07:09 pedrobaeza

Do you agree then to switch to the other PR?

pedrobaeza avatar Sep 13 '24 07:09 pedrobaeza

But I wasn't able to reproduce it on the same conditions, @aritzolea. It seems something that depends on the module stack. Did you do it on runboat? Anyway, as said, the other PR is more focused IMO.

I was able to reproduce the error in 16.0 runboat, and the solution in your PR's runboat

aritzolea avatar Sep 13 '24 08:09 aritzolea

OK, then are you ok with continuing with the other PR?

pedrobaeza avatar Sep 13 '24 08:09 pedrobaeza

OK, then are you ok with continuing with the other PR?

Yes, it can be continued on the other PR.

aritzolea avatar Sep 16 '24 08:09 aritzolea

Thanks.

pedrobaeza avatar Sep 16 '24 08:09 pedrobaeza