← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 744203] Re: Bug in skills management scale grade

 

Hey Azazahmed,
I dont think it is fixed. Applied your fix on a fresh database install. Getting same error as Nina:


Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 1643, in fields_view_get
    xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 1326, in __view_look_dom_arch
    fields = self.fields_get(cr, user, fields_def.keys(), context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 2927, in fields_get
    return super(orm, self).fields_get(cr, user, fields, context, write_access)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 1133, in fields_get
    res[f]['selection'] = field_col.selection(self, cr, user, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/hr_skill.zip/hr_skill/hrskill.py", line 29, in _currency_get
    return [(r['name'],r['name']) for r in res]
KeyError: 'code'


Please confirm this is what you have in your hrskill.py and what are the exact steps in updating a branch as you mentioned:
from osv import fields,osv


def _currency_get(self, cr, uid, context={}):
        obj = self.pool.get('res.currency')
        ids = obj.search(cr, uid, [])
        res = obj.read(cr, uid, ids, ['name'], context)
        return [(r['name'],r['name']) for r in res]

def _status_get(self, cr, uid, context={}):
        obj = self.pool.get('employee.status')
        ids = obj.search(cr, uid, [])
        res = obj.read(cr, uid, ids, ['name'], context)
        return [(r['name'],r['name']) for r in res]

class hr_lang(osv.osv):
    _description ='Languages'
    _name = 'hr.lang'
    _columns = {

        'name':fields.char('Language',size=64),
              }
hr_lang()

class emp_lang(osv.osv):
    _description ='Languages'
    _name = 'emp.lang'
    _columns = {
        'ii_id': fields.many2one('hr.employee','languages known'),
        'name':fields.many2one('hr.lang','Language'),
        'read': fields.boolean('Read'),
        'write': fields.boolean('Write'),
        'speak': fields.boolean('Speak'),
        }
emp_lang()

class hr_scale(osv.osv):
    _description ='Pay Scales'
    _name='hr.scale'

    _columns = {
         'code' : fields.char('Code', size=64,),
         'name' : fields.char('Name', size=64),
         'cur' : fields.selection(_currency_get, 'Currency', method=True),
         'min_sal' : fields.integer('Minimum Salary'),
         'max_sal' : fields.integer('Maximum Salary'),
         'increase' : fields.integer('Step Increase'),

                }
hr_scale()

class hr_employee(osv.osv):
    _description ='Employees'
    _name='hr.employee'
    _inherit='hr.employee'
    _columns = {
         'lang_id':fields.one2many('emp.lang','ii_id','Languages Known'),
         'leavedate' : fields.date('Leaved on'),
         'status' : fields.selection(_status_get, 'Employee Status', method=True,),
         'payscale':fields.many2one('hr.scale','Scale'),
        }
hr_employee()

class employee_status(osv.osv):
    _name = 'employee.status'
    _columns = {
                'name' : fields.char('Status Name', size=128, required=True)
               }
employee_status()

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/744203

Title:
  Bug in skills management scale grade

Status in OpenERP Modules (addons):
  Fix Released

Bug description:
  I have installed the skills management module, but under
  HR->Configuration->Skills Management->Scale Grade, when i click, i get
  this error:

  Traceback (most recent call last):
    File "netsvc.pyo", line 489, in dispatch
    File "service\web_services.pyo", line 599, in dispatch
    File "osv\osv.pyo", line 122, in wrapper
    File "osv\osv.pyo", line 176, in execute
    File "osv\osv.pyo", line 167, in execute_cr
    File "osv\orm.pyo", line 1635, in fields_view_get
    File "osv\orm.pyo", line 1318, in __view_look_dom_arch
    File "osv\orm.pyo", line 2908, in fields_get
    File "osv\orm.pyo", line 1125, in fields_get
    File "C:\Program Files\OpenERP 6.0\Server\addons\hr_skill.zip\hr_skill\hrskill.py", line 29, in _currency_get
  KeyError: 'code'



Follow ups

References