summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonin Bourguignon <abo@openerp.com>2012-10-11 15:58:09 +0200
committerAntonin Bourguignon <abo@openerp.com>2012-10-11 15:58:09 +0200
commit90ff5bf65a0e2e7bc18e45d1b0bd23e8e66b1f76 (patch)
tree7a6a5482aa859b240f9c77aad574d6709a9f8ff8
parent0ef3d13a3462150eea17e2efb19f0337340420f1 (diff)
[IMP] properly fetch events that have no registration
in order to achieve that, remove the previous patch which was too exclusive (WHERE r.id IS NOT NULL) and use 'virtual' ids instead the unicity is guaranteed by concatenating the event id and the registration id (if any) bzr revid: abo@openerp.com-20121011135809-fag9br23hthrwy1s
-rw-r--r--addons/event/report/report_event_registration.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/addons/event/report/report_event_registration.py b/addons/event/report/report_event_registration.py
index eae2931fcdc..042676d0c32 100644
--- a/addons/event/report/report_event_registration.py
+++ b/addons/event/report/report_event_registration.py
@@ -56,10 +56,10 @@ class report_event_registration(osv.osv):
tools.drop_view_if_exists(cr, 'report_event_registration')
# TOFIX this request won't select events that have no registration
- cr.execute(""" CREATE OR REPLACE view report_event_registration AS (
+ cr.execute(""" CREATE VIEW report_event_registration AS (
SELECT
- event_id,
- r.id,
+ 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,
@@ -79,8 +79,6 @@ class report_event_registration(osv.osv):
event_event e
LEFT JOIN event_registration r ON (e.id=r.event_id)
- WHERE r.id IS NOT NULL
-
GROUP BY
event_id,
user_id_registration,