lp:~numerigraphe/openobject-server/trunk-read_group-having
Abandoned because refused upstream, but other ways were probably implemented in between
This branch adds a new parameter named "having" to orm.read_group(), that lets clients pass the information to filter the grouped records based on the sum (or avg, etc.) of a value.
This parameter should contain a domain-like list of tuples, that the ORM will use to add a "HAVING" clause to the SQL query.
For an example of how this feature is useful, please see lp:~numerigraphe/openobject-addons/trunk-stock-analysis-filter-zero, where we use the "having" parameter to filter out results with quantity = 0 in stock analysis. This can only be done after the records have been grouped (the goods may have gone in then out of a location).
This is only really useful if clients support it too. Support for the GTK client has been added in lp:~numerigraphe/openobject-client/trunk-read_group-having.
- Get this branch:
- bzr branch lp:~numerigraphe/openobject-server/trunk-read_group-having
Branch merges
- OpenERP Framework Experts: Pending requested
- OpenERP Core Team: Pending requested
-
Diff: 41 lines (+14/-3)1 file modifiedopenerp/osv/orm.py (+14/-3)
Related bugs
Bug #691534: [trunk] Inventory analysis displays lines with quantity is zero | Wishlist | Won't Fix |
Related blueprints
Branch information
Recent revisions
- 4151. By Numerigraphe - Lionel Sausin <email address hidden>
-
[FIX] properly initialize context and having in read_group()
- 4150. By Philippe Rossi & Lionel Sausin
-
[IMP] orm: add a 'having' parameter to read_group() to filter grouped records
- 4148. By Raphael Collet (OpenERP)
-
[MERGE] trunk-remove_
group_extended- rco (remove group extended view) - 4142. By Xavier (Open ERP)
-
[FIX] previous fix: actual module should be __builtin__
apparently we do weird things with __builtins__, on my machine it's consistently an alias to the __builtin__ importable module, but in the server it's a dict
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:openobject-server