openerp 7.0 read_group dont compute aggreated fields on inherits table
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP's Framework R&D | |||
OpenERP Community Backports (Server) | Status tracked in 7.0 | |||||
7.0 |
New
|
Undecided
|
Unassigned |
Bug Description
If you look in human Resources-> timesheet activities, by default we have a total on Duration columns, this fields come from account analytic line. Sum work fine, but if you try to group by user, you dont have total.
Problem come from osv/orm.
2 change needed to fix that
1)
aggregated_fields = [
f for f in fields
if f not in ('id', 'sequence')
if fget[f]['type'] in ('integer', 'float')
if (f in self._columns and getattr(
f in self._all_columns and getattr(
)]
This change will tell to openerp to take the fields in aggregated_fields table if he come from a inherits
2)
for f in aggregated_fields:
if flist:
if f in self._columns: #IF COLUMNS COME FROM TABLE, DO NORMALY
flist += "%s(%s) AS %s" % (group_operator, qualified_field, f)
This Change will tell to openerp which columns he need to include in the Select query.
With this change on our side, all work fine now !
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 23 lines (+7/-2)1 file modifiedopenerp/osv/orm.py (+7/-2)
- Alexandre Fayolle - camptocamp: Approve
- Holger Brunn (Therp): Approve (code review)
-
Diff: 23 lines (+7/-2)1 file modifiedopenerp/osv/orm.py (+7/-2)
Hi Serge,
This bug affects me also and I have come up with a similar fix. (Please see attached branch for trunk).
Thanks,
Craig