Accounting "Statements" are auto sorted on date, instead of input sequence

Bug #430690 reported by Jan Verlaan
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3

Bug Description

Version 5.0.x bzr latest today

When inserting manually new lines into a statement (bank or cash) it is normally done in a sequence of your paper bank or cash statements.
Now OpenERP re-sorting automatically the input lines based on date. Result is that I lose control with my paper version and don't know anymore what is inputted already.
This behavior is also very disturbing when I have a amount difference at the end. Trying to find the record that is inputted with the incorrect amount, can not be checked anymore with the paper version line by line as the lines in openERP are re-sorted and can not be sorted on input sequence.

Please change the default sequence to input sequence.

Related branches

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thank you for reporting.

Improved by revision 2310 <email address hidden>.

Changed in openobject-addons:
status: New → Fix Released
Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Thanks Jay,
can we expect this solution in current stable version also?

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Jan,

This has been solved in trunk, because we added a new column here in table.

This was not a flow-breaking issue, otherwise it would have been fixed in stable. For your sake of simplicity, you may adopt these changes into your local code.

Thank you.

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Thanks Jay.
I have imported the patch into my test environment. I see the column and it can be filled.
Still I have a few remarks, hope you will underline too.

1. When inserting a new line the new sequence field is populated always with 10. As it represents the input sequence, can you adopt a generator on this fields thats higher up the sequence automatically with every new line inserted?
2. Still it is not possible to sort on this column, ergo there is something broken. No other column in this vieuw can be sorted anymore! Why? I checked the code but could not find it.
3. Can the _order be extended from _order = "date,name desc" to _order = "sequence,date,name desc" so input sequence will be the main sort if used by user?

If that's done, then the form will be useful as it resolves the issue mentioned into the bug description.
Thanks,
Jan

Changed in openobject-addons:
status: Fix Released → In Progress
Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Just thinking about the easiest solution.
There is no need for a sequence field from user perspective. This known and only want to have default sorting on input sequence, the solution could be to only add the "id" to the _order. Then the other code can be deleted and we have the behaviour we wanted. Still user can sort eventually other columns by click in column-name.

Then this solution can also be adopted in stable as there are no table changes. :-) :-)

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Reverted the patch so I got the original situation, deleted the table manually in postgres and changed _order from _order = "date,name desc" to _order = "id" in account_bank_statement.py line 540
started server with update = all to revert changes in view and table def.

Test result: the statement lines are listed in input sequence, can again sort by column by click on column name. ctrl-r set the default sorting back to input sequence. I think this is what we want, at least I would be happy with this solution.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Jan,

You are right undoubtedly.

This was one of the solutions we adopted earlier. id is always the input sequence.
But may be, as an account-specialist one would want to examine the statement lines sorted under dates.

We will plan to resolve this issue soon.
Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Jan,

We finally considered that,in general use; any bank statement comes into date-sorted manner.

So, we should not change the usual behavior.
In normal cases, entries have to be sorted by date(for the sake of simplicity ,eye-based easy naked comparison of transaction).

So I would like to have an easy solution : create a small module and have it applied on it.

I need to revert this patch.

Thanks.

Changed in openobject-addons:
status: In Progress → Invalid
Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Thanks for your consideration, but I partly agree.

What to do when your (bank) statement contains 100 lines on the same date. (My customers has) Now it is sorted based on date, name, while the paper statement is sorted based on transaction sequence (per date).
Resulting that input sequence in OpenERP will be destroyed by the current _order behavior and thus losing the overview. My paper version sequence does not correspond any more with the OpenERP sequence.
I really would like to see the possibility to have the option to sort on input sequence.

Same for importing transactions, they are not anymore in sequence with the import file due to the sorting behavior!

Please reconsider your statement and take into account then big statement files with many transactions on the same date.

Thanks, Jan

Changed in openobject-addons:
status: Invalid → In Progress
Revision history for this message
Husen Daudi (husendaudi) wrote :

Hello Jan.

If we convert date field from fields.date to fields.datetime then our problem could be solve.
what you say?

Regards,
HDA

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Thanks hda,
Yes, that would be definitely better as the current situation, but still it will not guaranty the inputted sequence. At least into the Netherlands the bank statement files are based on input transaction, resulting that for example banking cost are inserted by bankoffice with a date before the transaction date. So here it would definitively go wrong.

From the other side, I really don't understand why we would not have a option to sort on insert sequence, as this is the only way to control statements in openerp with bankstatements (manually inserted from paper or imported from file)
Why by default always resort differently? If accountant want to sort on date, he is able to do so by click on column name, or do I miss something here?

Data inconsistency is one of the caveats for every ERP and manually input will always contain errors by mistyping. So we have to deliver software that will utilize the user to control the input.
Now this is not possible, because while user input the next line, the index is reordering directly and my previous line could be switched to a other place.

Hope you understand what I'm trying to say. Just insert some statement lines with the second line with a previous date and the insert the 3th line. The second line is now switched to line 1 from line 2. Then imaging you insert 100 lines and you definitly lose control.

Changed in openobject-addons:
importance: Undecided → Wishlist
Revision history for this message
Chris Halls (halls) wrote :

I've had the same problem when trying to input lots of lines on the same date from a bank statement. My suggestion would be to sort on date, and then id (_oder = "date, id"). That way, transactions on the same date will be sorted in input order. This is most likely to match the sequence on the bank statement. But if you do forget a line and enter it later, you'll still see it together with the other entries for that date. I think it would be acceptable for an accountant as transactions would still be sorted primarily by date.

->hda: I've not seen bank statements that give times in the UK or Germany, so that would not work in at least those countries.

Chris

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Sort statement by date desc, id desc

Changed in openobject-addons:
status: In Progress → Confirmed
importance: Wishlist → Low
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
vth(openerp) (vth-tinyerp) wrote :

Hello,

I had done changes in branch - lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-vth2
revision <email address hidden>

Thanks,
vth

qdp (OpenERP) (qdp)
Changed in openobject-addons:
milestone: none → 6.0-rc2
Changed in openobject-addons:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.