Merge lp://staging/~credativ/ocb-server/7.0-lp1166886 into lp://staging/ocb-server
Proposed by
Craig Gowing (credativ)
Status: | Rejected |
---|---|
Rejected by: | Holger Brunn (Therp) |
Proposed branch: | lp://staging/~credativ/ocb-server/7.0-lp1166886 |
Merge into: | lp://staging/ocb-server |
Diff against target: |
41 lines (+6/-0) 2 files modified
openerp/osv/fields.py (+5/-0) openerp/osv/orm.py (+1/-0) |
To merge this branch: | bzr merge lp://staging/~credativ/ocb-server/7.0-lp1166886 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Holger Brunn (Therp) | Disapprove | ||
Olivier Dony (Odoo) (community) | surface scan, no test | Needs Information | |
Review via email: mp+182853@code.staging.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 5075. By Craig Gowing (credativ)
-
[IMP] Additional parameter on fields which allow aggreation to be disabled
I understand it would sometimes be useful to disable the default aggregation mechanism for some columns, however I have some objections to this MP:
1. This is an API change targeted at 7.0, and one for a very wishlist behavior. I think this really belongs to trunk. For 7.0 there are some possible workarounds:
- use a `group_operator` that gives a more acceptable behavior, such as `min`, `count` or perhaps `NULL*count` that would always render as 0.0.
- if that's still not good enough, write a small helper function that returns a special read_group() function that drops the relevant column(s) from the result given by the super() call. Assign this special function as the read_group() method in models that need it.
2. If we intend to improve the API in trunk to support a finer-grained control on aggregation, we should use this opportunity to improve the design further and really delegate the aggregation decision to the fields themselves, instead of mostly hardwiring it in read_group(). This should only be a small variation to your patch, so if it seems acceptable to you, you could update your branch and resubmit it for trunk.
Apart from the above, does your patch actually work in its current state? (I did not test) It seems read_group() is accessing an 'allow_aggregation' item that fields_get() never returns, which should cause KeyErrors for any column except id/sequence?
Thanks!