Order reconcile line per maturity date
It is better to try first to reconcile older lines.
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Cédric Krier assigned to @ced
assigned to @ced
- Cédric Krier added accounting type::behavior + 1 deleted label
added accounting type::behavior + 1 deleted label
- Cédric Krier added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
review357811003 updated at https://codereview.tryton.org/357811003/#ps320951002
New review349721003 at https://codereview.tryton.org/349721003/#ps342121002
review349721003 updated at https://codereview.tryton.org/349721003/#ps361671003
I have no idea what the changes are doing but they seem weird to me. I thought this is something in the reconcile code (in https://hg.tryton.org/modules/account/file/tip/move.py#l1628). The problem described at https://discuss.tryton.org/t/reconcile-always-takes-the-newest-invoice/4064/2 has basically nothing to do with the periods. It is even possible that the invoice is in period 1 and the payment in period 3. But if there is another invoice in period 2 with the exact same amount, that invoice is taken instead of the invoice in period 1.
That said, I can be completely mistaken. I'm going to test the patch and see if it works.
Hmm, I think the review is linked to the wrong issue. This review should be linked to #10292 (closed).
The reconciliation wizard search for all the possible lines for a party and then tries to get a close a possible match. When there is a close match, it will break out of the loop.
So I sorted the lines in the search with
order=[('id', 'ASC')]
, so the oldest ids are at the start of the list. This works nicely, but is it a good approach? or is sorting oncreate_date
orwrite_date
better?- Author Owner
The proposed review does already such ordering on the maturity date.
New changeset 05a3dd4ca183 by Cédric Krier in branch 'default':
Sort lines by maturity date to reconcile older first
https://hg.tryton.org/modules/account/rev/05a3dd4ca183- Roundup Robot added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
- Roundup Robot closed
closed
New changeset 902c8da66afc by Cédric Krier in branch 'default':
Sort lines by maturity date to reconcile older first
https://hg.tryton.org/tryton-env/rev/902c8da66afc