Comment 12 for bug 1127198

Revision history for this message
Niels Huylebroeck (red15) wrote :

Let me reiterate what is troubling on your suggested solution:

Whenever you import an invoice on the bank statement the voucher date is not set to the statement date (or the line date) but is instead still set to the date which was on invoice move. This creates confusion whenever a user is trying to correct the reconcilements from his bank statements by looking at all the draft vouchers (via the menu, not from the bank statement).

Your fix is overwriting the date of the voucher the moment you confirm the voucher, this is a blind leap of faith imo, the user can see the voucher's date is wrong and has to trust that OpenERP will correctly apply the date that was on the statement line ?

My solution makes it so the voucher's date is by default on the same date as the statement, this makes it easier to find the voucher when looking at them (while still draft).

I understand my solution does indeed not fix the problem where changing the statement line date should change (if present) the date on the voucher. It seems a simpler and cleaner solution to apply an on_change handler on the statement.line date field which would check if a voucher is present and change the date on that voucher to match the changed date (again only if the voucher is not confirmed obviously, otherwise we should raise an error and notify the user that he cannot change the date on a confirmed voucher)

I will see about adding an on_change handler on the statement line date field in my fix.