Trigger name in server actions does not show all the signals

Bug #437915 reported by Marcelo Hamra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openerp-server (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: openerp-server

The dropdown list "trigger name" in "Server Actions" form view doesn't show all the available signals of the system.

This is the original code, it seems ther is a bug in the query
    def _select_signals(self, cr, uid, context={}):
        cr.execute("select distinct t.signal as key, t.signal || ' - [ ' || w.osv || ' ] ' as val from wkf w, wkf_activity a, wkf_transition t "\
                        " where w.id = a.wkf_id " \
                        " and t.act_from = a.wkf_id " \
                        " or t.act_to = a.wkf_id and t.signal not in (null, NULL)")
...
        return res

The right version should be
        cr.execute("select distinct t.signal as key, t.signal || ' - [ ' || w.osv || ' ] ' as val from wkf w, wkf_activity a, wkf_transition t "\
                        " where w.id = a.wkf_id " \
                        " and t.act_from = a.id " \
                        " or t.act_to = a.id and t.signal not in (null, NULL)")

I'm using openerp server version 5.0.5 in linux downloaded from Openerp.com

Regards.

Revision history for this message
Marcelo Hamra (marcelo-hamra) wrote :

last but not least, I think it is better to change to use "case when t.signal is null then '' else t.signal end = ''" instead of "t.signal not in (null, NULL)"

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.