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

[13.0][IMP] account_payment_partner: Make payment mode editable on journal item

Open pedrobaeza opened this issue 1 year ago • 4 comments

This field was editable in previous version before invoice > move refactoring, and it's logic to allow to change payment mode once the invoice has been posted without the need of resetting it to draft.

Thus, the field has been changed to computed writable field, taking care of the consequences at model level (compute) and view level (add the field in views + proper attrs).

This commits adds tracking=True to the payment mode field as well to be aware when and who the payment mode is changed in the invoice, no matter if directly changed in draft, or through the change on the journal item.

@Tecnativa TT39850

pedrobaeza avatar Oct 07 '22 15:10 pedrobaeza

cc @douglascstd

marcelsavegnago avatar Oct 07 '22 16:10 marcelsavegnago

It allow you to change payment mode even you have a confirmed payment order

As we are doing the change in this module, we don't know yet about payment orders. I have changed it for a good compromise right now in this module: it's readonly if the item is reconciled. This covers all the done payment orders. For non done payment orders, it can be debatable if it should be restricted, as you can select items to be included in a payment order even if the payment mode doesn't match (through the option on the wizard), so it's not incoherent at all to leave it this way.

Why allow from journal item and not from invoice directly?

Indeed it can be put to be modified on the header, but then you will need to handle the non propagation of the value if there are several AR/AP lines to the ones that are reconciled. I won't handle it in this PR, as the aim is to have it editable at journal item view level, and also on the tree view of account_due_list (later PR coming).

This change is not tracked anywhere

I have added tracking=True to the field at account.move level to tackle this.

pedrobaeza avatar Oct 08 '22 09:10 pedrobaeza

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 Oct 12 '22 16:10 OCA-git-bot

Hello Guys,

I made the test, and it was updated the payment mode after you edit the field and save it. Make sure that this changing doesn´t affect the journals entries, because this changing at this level, is not allowed in brazilian accounting system. (for a certified system) As far as I have checked this is only affecting the invoice details, which is ok for me, even seems weird to me to make it through journal items, but, if this a system limitation, I'm ok with that.

Good work guys!

Benedito Monteiro Brazilian Certified Accountant 5243-O/4 SP

beneditomonteiro avatar Oct 16 '22 09:10 beneditomonteiro