Issue 3703

Show sum of all loaded selected records
Nosy list
albertca, ced, pokoli, risto3, yangoon
Assigned to

Created on 2014-02-22.13:03:28 by albertca, last changed 18 months ago by ced.


Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-09-25.14:56:25
Querying the server to make the sum may be too expensive but I think we need a solution that allows the user to get the information if he wants.
A possible solution would be to have each sum computed if the record included are loaded (like review3721002) but also allow the user to click on the sum to force the load and the computation. This way the computation of large sets is on demand.
Author: [hidden] (risto3)
Date: 2017-11-25.12:44:36
There is need for an immediate solution, even stop-gap as Albert indicates.
It is unacceptable to select lines in a client without feedback on the amounts involved ... absolutely crucial when reconciling lines.

Is it possible to at least update the initial proposal with a patchset compatible with current 'develop' branch?
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2014-02-27.22:09:04
I don't agree. In Tryton, we always try to provide the best solution so it is
better to wait until the right/best solution is developped.
Author: [hidden] (albertca)
Date: 2014-02-27.19:12:33
I think we could commit this solution as it is an improvement over existing 
behaviour and think about the other proposals as possible future improvements.
Author: [hidden] (albertca)
Date: 2014-02-23.06:59:28
The problem I see by asking the server is that it can be very annoying in slow 
networks that simply selecting records makes a server call. Also making it work 
on client and server and making it flexible can be complicated or you'd need to 
support a set of operations such as sum & avg only.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2014-02-22.20:59:52
Don't understand what you mean by "allow the view to call a custom per model
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2014-02-22.20:44:02
I'm not sure about the API, I find it not very powerful.
I'm wondering if we really need to add a new method or just allow the view to
call a custom per model method.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2014-02-22.20:30:47
What Cédric says makes sense for me, so why not adding a server function that
computes the aggreate like: 

def aggregate(cls, ids, fields, type='sum'):

that should return a dict with the fields in the keys and the computed aggregate
as value.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2014-02-22.18:28:50
I'm wondering if we should not try to implement a always workable solution.
I think we could try to design an API to get the server computes the sum (or any
other aggregate) based on a list of ids. So when the client has all the records
loaded, it does the computation and when it is not it asks to the server.
Author: [hidden] (albertca)
Date: 2014-02-22.13:03:26
Tryton client only shows totals of selected records if all records are loaded. 
This is an unnecessary limitation. The following review shows sum of selected and 
loaded records.

Date User Action Args
2020-04-02 12:49:06cedsettitle: tryton: Show sum of all loaded selected records -> Show sum of all loaded selected records
2019-09-25 14:56:37cedsetcomponent: + tryton, sao
2019-09-25 14:56:30cedsetpriority: wish -> feature
2019-09-25 14:56:26cedsetmessages: + msg52038
2019-05-06 21:53:55cedlinkissue8335 superseder
2017-11-25 12:44:37risto3setnosy: + risto3
messages: + msg37042
2017-11-20 19:44:25cedlinkissue6955 superseder
2017-11-20 19:43:44cedlinkissue2515 superseder
2014-02-27 22:09:04cedsetmessages: + msg15799
2014-02-27 19:12:33albertcasetmessages: + msg15798

Showing 10 items. Show all history (warning: this could be VERY long)