This question has been flagged
1 Reply
3739 Views

Hi

I installed OpenERP on my own server and I was installing new modules until I ran into the following error:

Integrity Error

The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: name - name]

I'm not able to install nor uninstall any modules anymore. The log contains the following message

Traceback (most recent call last):
  File "/opt/openerp/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint
DETAIL:  Failing row contains (14, 1, 2014-09-14 20:44:02.10987, 2014-09-14 20:44:02.10987, 1, 1, null, null, null, 1, t, null, user).

2014-09-14 20:44:03,009 1091 ERROR endare openerp.tools.convert: Parse error in /opt/openerp/server/openerp/addons/hr_evaluation/hr_evaluation_data.xml:1185:
<record id="hr.employee" model="hr.employee">
            <field name="evaluation_plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
        </record>
Traceback (most recent call last):
  File "/opt/openerp/server/openerp/tools/convert.py", line 852, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/opt/openerp/server/openerp/tools/convert.py", line 819, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/opt/openerp/server/openerp/addons/base/ir/ir_model.py", line 971, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/opt/openerp/server/openerp/addons/hr_holidays/hr_holidays.py", line 477, in create
    return super(hr_employee, self).create(cr, uid, vals, context=context)
  File "/opt/openerp/server/openerp/addons/hr/hr.py", line 222, in create
    employee_id = super(hr_employee, self).create(cr, uid, data, context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4444, in create
    record_id = self.pool.get(table).create(cr, user, tocreate[table], context=parent_context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4515, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/opt/openerp/server/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/openerp/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint
DETAIL:  Failing row contains (14, 1, 2014-09-14 20:44:02.10987, 2014-09-14 20:44:02.10987, 1, 1, null, null, null, 1, t, null, user).

Does anyone has an idea on how to fix this without reinstalling openERP or my databse? I read something online about a problem when you remove the admin account as employee. I have no idea whether that has anything to do with this or not?

Avatar
Discard
Best Answer

2014-09-14 20:44:03,009 1091 ERROR endare openerp.tools.convert: Parse error in /opt/openerp/server/openerp/addons/hr_evaluation/hr_evaluation_data.xml:1185:
<record id="hr.employee" model="hr.employee">
            <field name="evaluation_plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
        </record>

The line above basically tells you that OpenERP was trying to import data from an XML file (which is very common) when trying to install a module, most likely hr_evaluation, but the data is somehow incorrect.

In this case, the "name" field is missing from the data. Try editing that file at the indicated row (1185) and adding a name field with some value to it. See if that works out.

Avatar
Discard