Odoo Help


Key (sale_id)=(9) is not present in table "sale_order"

ZHANG shuo
on 2/26/14, 2:57 PM 1,934 views

After i restart the server , i cant login, and get error:

OpenERP Server Error Client Traceback (most recent call last): File "I:\workspace_for_OpenERP\openerp\openerp\addons\web\http.py", line 204, in dispatch response["result"] = method(self, **self.params) File "I:\workspace_for_OpenERP\openerp\openerp\addons\web\controllers\main.py", line 869, in authenticate req.session.authenticate(db, login, password, env) File "I:\workspace_for_OpenERP\openerp\openerp\addons\web\session.py", line 115, in authenticate uid = self.proxy('common').authenticate(db, login, password, env) File "I:\workspace_for_OpenERP\openerp\openerp\addons\web\session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "I:\workspace_for_OpenERP\openerp\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 "I:\workspace_for_OpenERP\openerp\openerp\addons\web\session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "I:\workspace_for_OpenERP\openerp\openerp\netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "I:\workspace_for_OpenERP\openerp\openerp\service\web_services.py", line 433, in dispatch return fn(params) File "I:\workspace_for_OpenERP\openerp\openerp\service\web_services.py", line 444, in exp_authenticate res_users = pooler.get_pool(db).get('res.users') File "I:\workspace_for_OpenERP\openerp\openerp\pooler.py", line 49, in get_pool return get_db_and_pool(db_name, force_demo, status, update_module)[1] File "I:\workspace_for_OpenERP\openerp\openerp\pooler.py", line 33, in get_db_and_pool registry = RegistryManager.get(db_name, force_demo, status, update_module) File "I:\workspace_for_OpenERP\openerp\openerp\modules\registry.py", line 192, in get update_module) File "I:\workspace_for_OpenERP\openerp\openerp\modules\registry.py", line 218, in new openerp.modules.load_modules(registry.db, force_demo, status, update_module) File "I:\workspace_for_OpenERP\openerp\openerp\modules\loading.py", line 341, in load_modules processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module) File "I:\workspace_for_OpenERP\openerp\openerp\modules\loading.py", line 256, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "I:\workspace_for_OpenERP\openerp\openerp\modules\loading.py", line 165, in load_module_graph init_module_models(cr, package.name, models) File "I:\workspace_for_OpenERP\openerp\openerp\modules\module.py", line 381, in init_module_models obj._auto_end(cr, {'module': module_name}) File "I:\workspace_for_OpenERP\openerp\openerp\osv\orm.py", line 3224, in _auto_end cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d)) File "I:\workspace_for_OpenERP\openerp\openerp\sql_db.py", line 161, in wrapper return f(self, *args, *kwargs) File "I:\workspace_for_OpenERP\openerp\openerp\sql_db.py", line 226, in execute res = self._obj.execute(query, params)

IntegrityError: insert or update on table "stock_picking" violates foreign key constraint "stock_picking_sale_id_fkey" DETAIL: Key (sale_id)=(9) is not present in table "sale_order".

How to fix it, anyone can help?

Can you show me your py file.

Krupesh Laiya
on 2/27/14, 12:57 AM

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.


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)


Asked: 2/26/14, 2:57 PM
Seen: 1934 times
Last updated: 3/16/15, 8:10 AM