Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

openerp 6.1 : no primary key

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
moduleinstall6.1
11 Respuestas
10558 Vistas
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
Mejor respuesta

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
Mejor respuesta

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
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
odoo-14: I get an error when I try to install a module in Digital Ocean Resuelto
module install
Avatar
Avatar
1
abr 21
6650
Unable to install module Resuelto
module install
Avatar
Avatar
2
abr 15
5458
how to install a module in openerp 7.0 windows?
module install
Avatar
Avatar
1
mar 15
4947
Click2dial module installation Resuelto
module install
Avatar
Avatar
Avatar
Avatar
3
ene 24
13105
Module Installation fails in OpenERP 6.1
crm module install 6.1 openerp
Avatar
Avatar
1
mar 15
6849
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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