odoo/odoo — pull request #4176 by rgo-odoo (2014-12-11 13:53:04+00:00)
Title: [FIX] Fixed the traceback faced when grouping records on the view having...

... computed and non-stored integer/float(ie, fields.Integer(compute='', store=False) field shown(maintenance: 619536).

This branch fixes issue #3972 which is related to non-stored computed fields of new api, when performing group by having such field.

The condition to build "aggregated_fields" list in read_group(...) needs to be a bit more strict, because the non-stored fields are not converted to "column" instance and hence the current check resulting into traceback.

Issue can be reproduced with slight modification in official event module, that is, if we add "count_registrations"(count_registrations = fields.Integer(...compute='_count_registrations')) field in either "view_event_tree" or "view_event_kanban" and if we perform "Group by" on any field, the system will crash with below traceback,

File "/[snip]/odoo/openerp/models.py", line 2101, in read_group
if getattr(self._fields[f].base_field.column, '_classic_write')
AttributeError: 'NoneType' object has no attribute '_classic_write'

This branch fixes it, kindly review it.

Thanks.