gant diagram does not display

Bug #271786 reported by Didrik Pinte
2
Affects Status Importance Assigned to Milestone
OpenERP
Fix Released
Undecided
Unassigned

Bug Description

Hi

On a fresh 4.2 installation, I have the following problem when asking the gant diagram on a project, I get the following error on the server side :

psycopg.ProgrammingError: ERROR: operator does ont exist : character varying = integer

LINE 1: ..our_from, hour_to from hr_timesheet here dayofweek=3 and tgr
                                                                                          ^
HINT : No operator matches the given name and argument type(s). You might need to add explicit type casts

I think it is related to the fact I use a PostgreSQL 8.3. An explicit cast should be mandatory.

I will try to propose a simple patch asap.

Didrik

Revision history for this message
Didrik Pinte (dpinte) wrote :

The correction is simple.

Correcting line 54 of bin/addons/hr/hr.py changing "dayofweek=%d" by "dayofweek=CAST(%d AS VARCHAR)" .

Didrik

Revision history for this message
Didrik Pinte (dpinte) wrote :

Same problem in bin/addons/hr/report/timesheet.py.

At ligne 100, the query should use the same typecast :

    sql = '''
    select t.hour_from, t.hour_to
    from hr_timesheet as t
      inner join (hr_timesheet_group as g inner join hr_timesheet_employee_rel as rel
               on rel.tgroup_id = g.id and rel.emp_id = %s)
      on t.tgroup_id = g.id
    where dayofweek = CAST(%s AS VARCHAR)
       and date_from = (select max(date_from)
            from hr_timesheet inner join (hr_timesheet_employee_rel
                  inner join hr_timesheet_group
                  on hr_timesheet_group.id = hr_timesheet_employee_rel.tgroup_id
                   and hr_timesheet_employee_rel.emp_id = %s)
               on hr_timesheet.tgroup_id = hr_timesheet_group.id
            where dayofweek = CAST(%s AS VARCHAR) and date_from <= '%s')
    order by date_from desc
    '''

Changed in openerp:
status: New → Fix Released
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.