Skip to Content
Menu
This question has been flagged
3 Replies
4415 Views

Upon installing the stock module from GUI or CLI, I'm getting this output. Ideas?


```

2017-09-07 15:01:02,705 11705 INFO server openerp.sql_db: bad query: ALTER TABLE "procurement_rule" ADD FOREIGN KEY ("route_id") REFERENCES "stock_location_route" ON DELETE set null 2017-09-07 15:01:02,\705 11705 ERROR server openerp.modules.registry: Failed to load registry Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 386, in new

    openerp.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 340, in load_modules

    loaded_modules, update_module)

  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 239, in load_marked_modules

    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)

  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 137, in load_module_graph

    init_module_models(cr, package.name, models)

  File "/usr/lib/python2.7/dist-packages/openerp/modules/module.py", line 307, in init_module_models

    obj._auto_end(cr, {'module': module_name})

  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper

    return old_api(self, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 2720, in _auto_end

    cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d))

  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 154, in wrapper

    return f(self, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 233, in execute

    res = self._obj.execute(query, params)

IntegrityError: insert or update on table "procurement_rule" violates foreign key constraint "procurement_rule_route_id_fkey"

DETAIL: Key (route_id)=(3) is not present in table "stock_location_route".

```

Avatar
Discard

Would you mind to let us know what you exactly did in order to get to this situation?

Author

Sure....nothing too out of the ordinary. Went to install Inventory Management (stock) module in the Apps tab. Clicked Install. Got a non-descript error on screen, while log output was the error seen above.

Best Answer

Hello Have you tried the process in a new database?

If the same problem occurs, switch the module file

Avatar
Discard
Author

Pretty sure it's just that database. I installed the module in an identical Odoo install as a test without an issue.

Related Posts Replies Views Activity
2
Dec 18
9862
1
Mar 17
4451
1
Dec 23
2590
0
Aug 20
1925
5
Nov 17
7223