Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    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
    Výroba
    • 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
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Invoice Numbers not be created?

Odoberať

Get notified when there's activity on this post

This question has been flagged
invoicevalidatesequence
12 Replies
15189 Zobrazenia
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
Zrušiť
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
Best Answer

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
Zrušiť
Avatar
Yogesh
Best Answer



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
Zrušiť
Avatar
explanar
Best Answer

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
Zrušiť
Avatar
patrick
Best Answer

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
Zrušiť
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 Best Answer

Any help would be greatly appreciated.

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
"Validate" button missing on invoices for users with Only Own Documents rights
invoice validate
Avatar
Avatar
Avatar
4
apr 25
2048
How to change Invoice sequence via xml in Odoo 15 or newer?
invoice sequence
Avatar
0
sep 24
2034
Odoo 17.1 - How to never reset invoice number
invoice sequence
Avatar
Avatar
2
mar 24
3893
How to select manually a sequence for an invoice? Solved
invoice sequence
Avatar
Avatar
2
feb 23
4536
Manually set invoice number Solved
invoice sequence
Avatar
Avatar
Avatar
Avatar
Avatar
6
okt 20
39244
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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