Displaying a Contract fails when Salary Structure is not set

Bug #1061213 reported by Robajz.info
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ACF OpenERP customization
Fix Committed
Critical
Robajz.info

Bug Description

The following error is thrown when Salary Structure is null (not set). The default OpenERP view makes the Salary Structure field mandatory, though this is not so in the data model.

The customization made this field optional in the view and this exposed an underlying problem.
This is at revision 22 of acf_custom.

Server Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/common/http.py", line 592, in send
    result = openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 572, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3381, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3504, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/usr/lib/pymodules/python2.7/openerp/osv/fields.py", line 1132, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/acf_custom/payroll.py", line 235, in get_expected_payslip_input_ids
    structure_ids = contract_obj.get_all_structures(cr, uid, ids, context=context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/hr_payroll/hr_payroll.py", line 146, in get_all_structures
    return list(set(self.pool.get('hr.payroll.structure')._get_parent_structure(cr, uid, structure_ids, context=context)))
  File "/usr/lib/pymodules/python2.7/openerp/addons/hr_payroll/hr_payroll.py", line 106, in _get_parent_structure
    if struct.parent_id:
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 476, in __getattr__
    return self[name]
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 391, in __getitem__
    field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3381, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3440, in _read_flat
    cr.execute(query, (tuple(sub_ids),))
  File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: integer = boolean
LINE 1: ..._payroll_structure" WHERE hr_payroll_structure.id IN (false)...
                                                             ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

Changed in acf-openerp-custom-main:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Robajz.info (robert-sevcik)
milestone: none → 1.0
Revision history for this message
Robajz.info (robert-sevcik) wrote :

Fixed in revision 23 - http://bazaar.launchpad.net/~acf-custom-openerp/acf-openerp-custom-main/trunk/revision/23

The original method to retrieve salary structures has been overridden and modified to allow contracts without salary structures.

Changed in acf-openerp-custom-main:
status: Confirmed → Fix Committed
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.