[7.0/saas-2/saas-3/trunk]Event: Server error on Events Analysis when having more then 10 events

Bug #1287066 reported by Muschang Anthony (Acsone)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

Scenario:
1/ Create 11 events if necessary, we need to have 10 events or more. (no registrations needed)
2/ Go to Reporting -> Event Analysis
3/ The error "OpenERP Server Error" is shown twice and no data is displayed in the graph.

We have the same problem in Dashboard/Events

This is the complete error:
Traceback (most recent call last):
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/http.py", line 363, in dispatch
    response["result"] = self._call_function(**self.params)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/http.py", line 220, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/http.py", line 215, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/http.py", line 560, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/http.py", line 267, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/addons/web/controllers/main.py", line 1205, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/addons/web/controllers/main.py", line 1197, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/home/odoo/runbot/static/openerp-dev-trunk-31504/server/openerp/osv/orm.py", line 2371, in read_group
    d['__domain'] = [(groupby, '=', alldata[d['id']][groupby] or False)] + domain
KeyError: 'event_type'

The origin of the error seem to come from the file "report_event_registration.py" in the module Event:
            SELECT
                e.id::char || '/' || coalesce(r.id::char,'') AS id,
                e.id AS event_id,
                e.user_id AS user_id,
                r.user_id AS user_id_registration,
                r.name AS name_registration,
                e.company_id AS company_id,
                e.date_begin AS event_date,
                count(e.id) AS nbevent,
                CASE WHEN r.state IN ('draft') THEN r.nb_register ELSE 0 END AS draft_state,
                CASE WHEN r.state IN ('open','done') THEN r.nb_register ELSE 0 END AS confirm_state,
                e.type AS event_type,
                e.seats_max AS seats_max,
                e.state AS event_state,
                r.state AS registration_state
            FROM
                event_event e
                LEFT JOIN event_registration r ON (e.id=r.event_id)
            GROUP BY
                event_id,
                user_id_registration,
                r.id,
                registration_state,
                r.nb_register,
                event_type,
                e.id,
                e.date_begin,
                e.user_id,
                event_state,
                e.company_id,
                e.seats_max,
                name_registration

The ids should be stored in a varchar instead of a char:
In the second line:
e.id::char || '/' || coalesce(r.id::char,'') AS id
should be replaced by:
e.id::varchar || '/' || coalesce(r.id::varchar,'') AS id

Tested with Chrome and Firefox.

Revision history for this message
Muschang Anthony (Acsone) (anthony-muschang) wrote :
Revision history for this message
Muschang Anthony (Acsone) (anthony-muschang) wrote :

Linked to opw-604774

summary: - [saas-3/trunk]Event: Server error on Events Analysis when having more
- then 10 events
+ [7.0/saas-2/saas-3/trunk]Event: Server error on Events Analysis when
+ having more then 10 events
Revision history for this message
Denis Ledoux (OpenERP) (dle-openerp) wrote :

Fix released in revision 9885 <email address hidden> in OpenERP Addons 7.0

Already forward ported to saas-2 and saas-3

Will be forward ported soon in trunk.

Changed in openobject-addons:
status: New → Fix Released
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.