there is no primary key for referenced table "res_user"

Asked by Joel Cabral

I'm trying to install modules but im having this problem:

Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/home/rvquimbo/Desktop/server/bin/netsvc.py", line 235, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/rvquimbo/Desktop/server/bin/netsvc.py", line 74, in __call__
    return getattr(self, method)(*params)
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/service/web_services.py", line 582, in execute
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/service/web_services.py", line 562, in _execute
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/wizard/__init__.py", line 178, in execute
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/wizard/__init__.py", line 74, in execute_cr
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/addons/base/module/wizard/wizard_module_upgrade.py", line 92, in _upgrade_module
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/pooler.py", line 62, in restart_pool
    return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/addons/__init__.py", line 718, in load_modules
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/addons/__init__.py", line 581, in load_module_graph
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/addons/__init__.py", line 366, in init_module_objects
  File "/home/rvquimbo/Desktop/server/bin/osv/orm.py", line 1504, in _auto_init
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/sql_db.py", line 76, in wrapper
    return f(self, *args, **kwargs)
  File "/home/rvquimbo/Desktop/thea_server/openerp-server-gtgf/bin/sql_db.py", line 120, in execute
    res = self._obj.execute(query, params)
ProgrammingError: there is no primary key for referenced table "res_users"

I know this is not a bug. I just want to know the reason why this is happenning.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Vinay Rana (OpenERP)
Solved:
Last query:
Last reply:
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello Joel,

I think this error only happened when you did some change in users class object fields. There is 'id' field which is generated automatically in database table, which will maintain all the reference with respect of name or rec_name.
Can you provide me more info regarding this issue for reproducing this error?

Thanks.

Revision history for this message
Joel Cabral (hephaestus) said :
#2

Hi vra,

I can't don't know what have i done to produce this error. I just notice this error when I try to install modules. All I remember, I just rename the default adiminstrator user and created another admin account with the same details as the default admin. I think it's been a month since I did that (adding another admin account).

I'm installing account_voucher module then this error came up. same error appear when I try to install other module.

thanks,

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#3

Hello Joel,

I have tried with all possible option which you did specified but i am not able to produce the same error.
Can you provide me your database backup via mail on my id : <email address hidden>,So it is very easy to me to produce it at my end.

Thanks.

Revision history for this message
Joel Cabral (hephaestus) said :
#4

I can't send my database to you. I don't know whats wrong... I'll try again tomorrow...

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#5

Hello Joel,

I think it will better to create new database instead of doing changes in corrupted database.

Thanks.

Revision history for this message
Joel Cabral (hephaestus) said :
#6

Hi vra,

But I am using that database for live production. Creating new database, I think, would not be the best option now. if this bug or lets say error comes out in a live database then this error should be prevented. Am I right??? Just askin...

thanks,

Revision history for this message
Best Vinay Rana (OpenERP) (vra-openerp) said :
#7

Hello Joel,

Yes , But you can take backup of your important data, Through export wizard and generate csv file for different object.You will import it again in to the new database.
May be some data are not exported but you can manage manually instead of finding solution of this type of critical error.

Thanks.

Revision history for this message
Joel Cabral (hephaestus) said :
#8

Thanks Vinay Rana (openerp), that solved my question.