Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

openerp 6.1 : no primary key

Subscriure's

Get notified when there's activity on this post

This question has been flagged
moduleinstall6.1
11 Respostes
10557 Vistes
Avatar
Mohammed Alkathmi

Hi,

I've this error when I try to install a module in openerp 6.1 ProgrammingError: there is no primary key for referenced table "res_users"

Client Traceback (most recent call last):
  File "/home/irachid/Bureau/server/openerp/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/home/irachid/Bureau/server/openerp/addons/web/controllers/main.py", line 1052, in call_button
    action = self.call_common(req, model, method, args, domain_id, context_id)
  File "/home/irachid/Bureau/server/openerp/addons/web/controllers/main.py", line 996, in call_common
    return self._call_kw(req, model, method, args, {})
  File "/home/irachid/Bureau/server/openerp/addons/web/controllers/main.py", line 1010, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/home/irachid/Bureau/server/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/home/irachid/Bureau/server/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/home/irachid/Bureau/server/openerp/addons/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


Server Traceback (most recent call last):
  File "/home/irachid/Bureau/server/openerp/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/irachid/Bureau/server/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/irachid/Bureau/server/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/irachid/Bureau/server/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/irachid/Bureau/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/irachid/Bureau/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/irachid/Bureau/server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/irachid/Bureau/server/openerp/addons/base/module/module.py", line 361, in button_immediate_install
    db, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/home/irachid/Bureau/server/openerp/pooler.py", line 39, in restart_pool
    registry = RegistryManager.new(db_name, force_demo, status, update_module, True)
  File "/home/irachid/Bureau/server/openerp/modules/registry.py", line 202, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/irachid/Bureau/server/openerp/modules/loading.py", line 338, in load_modules
    processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules)
  File "/home/irachid/Bureau/server/openerp/modules/loading.py", line 253, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules)
  File "/home/irachid/Bureau/server/openerp/modules/loading.py", line 170, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/home/irachid/Bureau/server/openerp/modules/module.py", line 378, in init_module_models
    result = obj._auto_init(cr, {'module': module_name})
  File "/home/irachid/Bureau/server/openerp/osv/orm.py", line 2832, in _auto_init
    self._add_log_columns(cr)
  File "/home/irachid/Bureau/server/openerp/osv/orm.py", line 3126, in _add_log_columns
    cr.execute('ALTER TABLE "%s" ADD COLUMN "%s" %s' % (self._table, field, field_def))
  File "/home/irachid/Bureau/server/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/home/irachid/Bureau/server/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
ProgrammingError: there is no primary key for referenced table "res_users"

Thanks

0
Avatar
Descartar
Francesco OpenCode

Can you copy the complete error of the log in a site like paste on in the answer?

Mohammed Alkathmi
Autor

I updated the post with the whole error, thanks

Francesco OpenCode

Have you deleted an user without delete relative partner?

Mohammed Alkathmi
Autor

I solved the problem by adding a constraint " CONSTRAINT res_users_pkey PRIMARY KEY (id) " to the table res_users, but the same error appeared for other tables, so I need to add this constraint on th Id field to all tables, have you any idea or script to do these in postgres?

Mohammed Alkathmi
Autor

No I didn't delete any user, I think that because of the backup of database by openerp web, We have have to backup / restore databases with postgres not throught openerp

Francesco OpenCode

I use to backup database by cli every time and I've not problem

TheBrush

Did you restore database before your installation? maybe the problem was this: https://bugs.launchpad.net/openobject-server/+bug/897098/comments/15

TheBrush

Did you previously restore database before your installation? maybe was that: https://bugs.launchpad.net/openobject-server/+bug/897098/comments/15

Avatar
Gustavo
Best Answer

res_users has a unique index that builds its primary key. Looks like something is wrong with your database, can you try creating another OpenERP database and checking the res_users table has a primary key?

1
Avatar
Descartar
Mohammed Alkathmi
Autor

I solved the problem by adding a constraint " CONSTRAINT res_users_pkey PRIMARY KEY (id) " to the table res_users, but the same error appeared for other tables, so I need to add this constraint on th Id field to all tables, have you any idea or script to do these in postgres?

Avatar
Michael Karrer
Best Answer

i do have the same problem on an v8 database - seems that an restore of the database through the odoo webinterface killed my db :( the solution with stopping and starting the service does not help me because my backup is already corrupt (i think) is there a simple way to restore all primary keys?

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
odoo-14: I get an error when I try to install a module in Digital Ocean Solved
module install
Avatar
Avatar
1
d’abr. 21
6650
Unable to install module Solved
module install
Avatar
Avatar
2
d’abr. 15
5456
how to install a module in openerp 7.0 windows?
module install
Avatar
Avatar
1
de març 15
4946
Click2dial module installation Solved
module install
Avatar
Avatar
Avatar
Avatar
3
de gen. 24
13103
Module Installation fails in OpenERP 6.1
crm module install 6.1 openerp
Avatar
Avatar
1
de març 15
6845
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now