Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Invoice Numbers not be created?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
invoicevalidatesequence
12 Răspunsuri
15200 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
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?

Imagine profil
Art
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Yogesh
Cel mai bun răspuns



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
Imagine profil
Abandonează
Imagine profil
explanar
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
patrick
Cel mai bun răspuns

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
Imagine profil
Abandonează
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

Imagine profil
Nicholas Coad
Autor Cel mai bun răspuns

Any help would be greatly appreciated.

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
"Validate" button missing on invoices for users with Only Own Documents rights
invoice validate
Imagine profil
Imagine profil
Imagine profil
4
apr. 25
2062
How to change Invoice sequence via xml in Odoo 15 or newer?
invoice sequence
Imagine profil
0
sept. 24
2042
Odoo 17.1 - How to never reset invoice number
invoice sequence
Imagine profil
Imagine profil
2
mar. 24
3903
How to select manually a sequence for an invoice? Rezolvat
invoice sequence
Imagine profil
Imagine profil
2
feb. 23
4539
Manually set invoice number Rezolvat
invoice sequence
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
6
oct. 20
39275
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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