Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

Invoice Numbers not be created?

Suscribirse

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

Se marcó esta pregunta
invoicevalidatesequence
12 Respuestas
15253 Vistas
Avatar
Nicholas Coad

I have a multi-company environment. For whatever reason, invoice sequence numbers are not be created. I have no idea why. It worked for my first 2 trials, but now I'm getting an error on validating invoices "Constraint Error Invoice Number must be unique per Company!"

The reason why it's not unique is because the invoice number its trying to use is just a slash "/".

I am using a user that is specific to that company. All my Warehouses, Locations, Accounts and Journals are specific to that company as well.

For images please see: imgur.com/a/FZtiN

Log:

    2013-05-29 22:05:16,888 436 ERROR mydb openerp.sql_db: bad query: update "account_invoice" set "number"='/' where id = 17
Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\sql_db.py", line 226, in execute
IntegrityError: duplicate key value violates unique constraint "account_invoice_number_uniq"
DETAIL:  Key (number, company_id, journal_id, type)=(/, 5, 27, out_invoice) already exists.

2013-05-29 22:05:16,888 436 ERROR mydb openerp.tools.safe_eval: Cannot eval u'action_move_create()'
Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\tools\safe_eval.py", line 241, in safe_eval
  File "", line 1, in <module>
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\orm.py", line 374, in function_proxy
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\openerp\addons\account\account_invoice.py", line 1012, in action_move_create
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\openerp\addons\mail\mail_thread.py", line 264, in write
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\orm.py", line 4270, in write
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\orm.py", line 4640, in _store_set_values
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\sql_db.py", line 161, in wrapper
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\sql_db.py", line 226, in execute
IntegrityError: duplicate key value violates unique constraint "account_invoice_number_uniq"
DETAIL:  Key (number, company_id, journal_id, type)=(/, 5, 27, out_invoice) already exists.

2013-05-29 22:05:16,888 436 ERROR mydb openerp.netsvc: Constraint Error
Invoice Number must be unique per Company!
Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\netsvc.py", line 293, in dispatch_rpc
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\osv.py", line 152, in wrapper
  File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\netsvc.py", line 72, in abort_response
except_osv: ('Constraint Error', 'Invoice Number must be unique per Company!')
2013-05-29 22:05:16,904 436 INFO mydb werkzeug: 10.0.4.17 - - [29/May/2013 22:05:16] "POST /web/dataset/exec_workflow HTTP/1.1" 200 -
2013-05-29 22:05:16,921 436 INFO ? werkzeug: 10.0.4.17 - - [29/May/2013 22:05:16] "GET /web/static/src/img/warning.png HTTP/1.1" 200 -
1
Avatar
Descartar
Luis Leiva

I have the same problem. I am using Versión 7.0-20130510-231240. I tried to cancel and re-validate an invoice which had a mistake and when revalidating I got the "Constraint Error Invoice Number must be unique per Company!" error. After that I am unable to make even a new invoice without getting the error. The next sequence number is ok and I have even tried with a far ahead number so I am sure there is no invoice with that number.

Nicholas Coad
Autor

My solution was to review every single accounting type setting by comparing it to a functional company. Fix any errors and then go into the database and manually delete the records without proper invoice numbers. It started working at that point.

Art

I'm having the same problem when I try to validate vendor bills in the accounting module. I'm not sure I understand the way you solve your problem. Could you please provide more details on it?

Avatar
Art
Mejor respuesta

Does anybody have this error in Odoo 10? It won't validate vendor bill because of this error. Even if I don't put the invoice number I still get this error.

0
Avatar
Descartar
Avatar
Yogesh
Mejor respuesta



Hi, that error says combination of (number, company_id, journal_id, type) should be unique.
Odoo automatically creates sequence for each new journal, later on posting entries in journal this sequence is read from this field, select correct sequence on journal of invoice should fix this. Probably would require to delete or edit name of move_id(Journal Entry) to get it working.



0
Avatar
Descartar
Avatar
explanar
Mejor respuesta

For me in Odoo V8 the error occured after having accidentially typed in "0" at the tax field of an invoice row and confirmed it by [Enter].

This made the system generate a VAT-Type named "0" without further configuration.

After this accidential happening, the error occurs at every invoice-confirmation.
Even after deleting the wrong VAT-Type "0" the error is still alive.

After a reboot of the Odoo-hosting machine / ubuntu 14.04-64 still no change:

 Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo/odoo-server/openerp/http.py", line 530, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo-server/openerp/http.py", line 567, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/openerp/http.py", line 303, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/http.py", line 300, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 796, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 396, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 960, in exec_workflow
    return request.session.exec_workflow(model, id, signal)
  File "/opt/odoo/odoo-server/openerp/http.py", line 1101, in exec_workflow
    r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id)
  File "/opt/odoo/odoo-server/openerp/http.py", line 872, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
  File "/opt/odoo/odoo-server/openerp/http.py", line 114, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 37, in dispatch
    res = fn(db, uid, *params)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 183, in exec_workflow
    return exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 177, in exec_workflow_cr
    return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id]
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 159, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3524, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/opt/odoo/odoo-server/openerp/workflow/__init__.py", line 85, in trg_validate
    return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)
  File "/opt/odoo/odoo-server/openerp/workflow/service.py", line 91, in validate
    res2 = wi.validate(signal)
  File "/opt/odoo/odoo-server/openerp/workflow/instance.py", line 75, in validate
    wi.process(signal=signal, force_running=force_running, stack=stack)
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 120, in process
    ok = self._split_test(activity['split_mode'], signal, stack)
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 248, in _split_test
    self._join_test(t[0], t[1], stack)
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 257, in _join_test
    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 95, in create
    workflow_item.process(stack=stack)
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 116, in process
    if not self._execute(activity, stack):
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 162, in _execute
    returned_action = self.wkf_expr_execute(activity)
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 313, in wkf_expr_execute
    return self.wkf_expr_eval_expr(activity['action'])
  File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr
    result = eval(line, env, nocopy=True)
  File "/opt/odoo/odoo-server/openerp/tools/safe_eval.py", line 314, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/odoo/odoo-server/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 518, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/ecoservice_financeinterface/account.py", line 272, in action_move_create
    thisreturn = super(account_invoice, self).action_move_create(cr, uid, ids, *args)
  File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 363, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/account/account_invoice.py", line 926, in action_move_create
    move.post()
  File "/opt/odoo/odoo-server/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 546, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/ecoservice_financeinterface/account.py", line 132, in post
    res = super(account_move, self).post(cr, uid, ids, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/account/account.py", line 1324, in post
    self.write(cr, uid, [move.id], {'name':new_name})
  File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/account/account.py", line 1365, in write
    result = super(account_move, self).write(cr, uid, ids, vals, c)
  File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 363, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3741, in write
    self._write(old_vals)
  File "/opt/odoo/odoo-server/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 546, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3987, in _write
    recs.recompute()
  File "/opt/odoo/odoo-server/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 5648, in recompute
    rec._write(values)
  File "/opt/odoo/odoo-server/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 546, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3852, in _write
    cr.execute(query, params + (sub_ids,))
  File "/opt/odoo/odoo-server/openerp/sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
ValueError: "duplicate key value violates unique constraint "account_invoice_number_uniq"
DETAIL:  Key (number, company_id, journal_id, type)=(VK/2015/0011, 1, 1, out_invoice) already exists.
" while evaluating
u'action_move_create()'
0
Avatar
Descartar
Avatar
patrick
Mejor respuesta

No real help, but does this same behaviour occur for another user with the same company?

If somehow the user does not have access to ir.sequence, this issue might occur.

Do you have any custom modules installed, that is, either own made or downloaded from internet?

0
Avatar
Descartar
Nicholas Coad
Autor

Hello, I do have a few custom modules, but none have anything to do with the invoicing system which is stock. My modules are separate and self-contained with an exception to an addition to the Product module (additional attributes, nothing fancy).

Nicholas Coad
Autor

The weird thing is that it used to work, so its something that I managed to break in the configuration, probably something in the accounting, but I cannot find it...

patrick

Was the setup originally multi company? Maybe if you specify the starting number for the invoices, it might work (Settings -> Sequences -> Sequences -> Debiteuren (or Debtors??) -> Edit -> change the value behind 'Next Number'

Nicholas Coad
Autor

Thank you for the suggestion, but I'm still stuck. Please take a look at the following images. Yes, it was originally set up as multicompany from day one.

Nicholas Coad
Autor

imgur.com/a/3J5mq

Avatar
Nicholas Coad
Autor Mejor respuesta

Any help would be greatly appreciated.

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
"Validate" button missing on invoices for users with Only Own Documents rights
invoice validate
Avatar
Avatar
Avatar
4
abr 25
2111
How to change Invoice sequence via xml in Odoo 15 or newer?
invoice sequence
Avatar
0
sept 24
2066
Odoo 17.1 - How to never reset invoice number
invoice sequence
Avatar
Avatar
2
mar 24
3955
How to select manually a sequence for an invoice? Resuelto
invoice sequence
Avatar
Avatar
2
feb 23
4601
Manually set invoice number Resuelto
invoice sequence
Avatar
Avatar
Avatar
Avatar
Avatar
6
oct 20
39372
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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