← Back to team overview

credativ team mailing list archive

Re: [Merge] lp:~credativ/account-banking/trunk-refresh into lp:account-banking/5.0

 

On 09/11/11 20:38, Pieter J. Kersten (EduSense BV) wrote:
> Review: Needs Information
>
> I'm not sure what this will do. All totals are taken from the import file and should be correct. There is no such thing as an "old" balance during import. Pressing this virtual button for each imported statement during import can introduce huge performance penalties (think of hundreds of statements per import). Why is this needed?

On the statement there are three fields related to balance:
* opening balance (user input)
* closing balance (user input)
* computed closing balance (OpenERP calculated)

Steps to reproduce the problem:
1) Import a file with 30 statements
2) All statements appear as red in the list view (computed balalance 
does not match closing balance)
3) Open each statement click "compute" balance.
4) Computed balance now matches with the closing balance

Technical reason is as follows:
First a blank statement is created and the computed balance becomes 
opening balance since there are no statement lines.
Statement lines are then added with the statement_id, but this does not 
trigger computed balance recalculation (performance hit).
One way to solve it is to pass a list of dictionaries to create one2many 
statement lines at the same time as the statement (but this can be a 
memory hog during import of very long statements).

So my proposal is to recalculate the computed balance once, after the 
statement file has been imported. The function I'm using is the same one 
as the form button "recompute balance". (Let me know if I put this in 
the wrong place). Alternatively it can happen later with a list of 
imported statement ids.

Does this explain the intention? I can make a video if you can't 
reproduce the problem locally.


-- 
With best regards,


Dmitrijs Ledkovs

credativ ltd                     Tel: 01788 298152
36 Regent Street                 Fax: 01788 298159
Rugby CV21 2PS - UK              http://www.credativ.co.uk

credativ Ltd is registered in England & Wales, company no. 5261743
Registered office: Nelson House, 2 Hamilton Terrace, Leamington Spa,
Warwickshire CV32 4LY

Certified by AccredIT UK with the ICT Supply standard of quality for
Software Product Design and Development

https://code.launchpad.net/~credativ/account-banking/trunk-refresh/+merge/81761
Your team credativ is subscribed to branch lp:~credativ/account-banking/trunk-refresh.


References