Odoo Help

0

Integrity error while updating database

v7
By
richa soni
on 4/10/14, 12:21 PM 2,728 views

Hello,

I am getting Integrity error while updating database.. i deleted some entries..how can i recover database.. or resolve this error. Below is error:

IntegrityError: insert or update on table "wkf_workitem" violates foreign key constraint "wkf_workitem_inst_id_fkey" DETAIL: Key (inst_id)=(1351) is not present in table "wkf_instance".

Client Traceback (most recent call last): File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, **self.params) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/addons/web/controllers/main.py", line 864, in authenticate req.session.authenticate(db, login, password, env) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/addons/web/session.py", line 115, in authenticate uid = self.proxy('common').authenticate(db, login, password, env) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/service/web_services.py", line 433, in dispatch return fn(params) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/service/web_services.py", line 444, in exp_authenticate res_users = pooler.get_pool(db).get('res.users') File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/pooler.py", line 49, in get_pool return get_db_and_pool(db_name, force_demo, status, update_module)[1] File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/pooler.py", line 33, in get_db_and_pool registry = RegistryManager.get(db_name, force_demo, status, update_module) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/modules/registry.py", line 193, in get update_module) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/modules/registry.py", line 219, in new openerp.modules.load_modules(registry.db, force_demo, status, update_module) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/modules/loading.py", line 301, in load_modules loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=update_module, report=report) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/modules/loading.py", line 165, in load_module_graph init_module_models(cr, package.name, models) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/modules/module.py", line 381, in init_module_models obj._auto_end(cr, {'module': module_name}) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/osv/orm.py", line 3243, in _auto_end cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d)) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/sql_db.py", line 161, in wrapper return f(self, *args, kwargs) File "/home/richa/Documents/openerp-7.0-20140113-001013/openerp/sql_db.py", line 226, in execute res = self._obj.execute(query, params) *IntegrityError: insert or update on table "wkf_workitem" violates foreign key constraint "wkf_workitem_inst_id_fkey" DETAIL: Key (inst_id)=(1351) is not present in table "wkf_instance".

Please tell me how to resolve. Thanks in advance

0

Brett Lehrer

--Brett Lehrer--
1272
| 5 5 8
Milwaukee, United States
--Brett Lehrer--
Director of IT and open source enthusiast.
Brett Lehrer
On 4/10/14, 1:39 PM

Run this SQL statement on your database:

DELETE FROM wkf_workitem WHERE inst_id=1351;

If you manually deleted a workflow instance but didn't cascade that out to the associated workitems, it'll try to join using a foreign key entry that goes to a non-existent row. This just drops that workitem so you can get back up and running.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 4/10/14, 12:21 PM
Seen: 2728 times
Last updated: 3/16/15, 8:10 AM