Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
4931 มุมมอง

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".

```

อวตาร
ละทิ้ง

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

ผู้เขียน

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.

คำตอบที่ดีที่สุด

Hello Have you tried the process in a new database?

If the same problem occurs, switch the module file

อวตาร
ละทิ้ง
ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ธ.ค. 18
10872
1
มี.ค. 17
5209
Can't delete buttons แก้ไขแล้ว
1
ธ.ค. 23
3415
0
ส.ค. 20
2349
5
พ.ย. 17
8076