İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Duplicate Key Violates Unique Constraint "Account_Invoice_Number_Uniq"

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
invoiceaccount.invoiceduplicatekey
2 Cevaplar
17164 Görünümler
Avatar
Michael Aigner

I just discovered a problem in our invoice generation. When I want to validate an invoice I get the following error message. When I look at that message, it looks like the invoice number is not passed correctly to the function ("/"):

"DETAIL: Key (number, company_id, journal_id, type)=(/, 1, 1, out_invoice) already exists."


Does anyone have an idea what is the problem here? I have already over 1000 invoices that worked fine, but suddenly it stopped. I also tried modifying the sequence, but this doesn't help at all.

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 537, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 574, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 310, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 307, in checked_call

return self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 803, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 955, in exec_workflow

return request.session.exec_workflow(model, id, signal)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1111, in exec_workflow

r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 879, in proxy_method

result = dispatch_rpc(self.service_name, method, args)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 115, in dispatch_rpc

result = dispatch(method, params)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 37, in dispatch

res = fn(db, uid, *params)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 188, in exec_workflow

return exec_workflow_cr(cr, uid, obj, signal, *args)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 182, in exec_workflow_cr

return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id]

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 164, in execute_cr

return getattr(object, method)(cr, uid, *args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3570, in signal_workflow

result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/__init__.py", line 85, in trg_validate

return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/service.py", line 91, in validate

res2 = wi.validate(signal)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/instance.py", line 80, in validate

wi.process(signal=signal, force_running=force_running, stack=stack)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 120, in process

ok = self._split_test(activity['split_mode'], signal, stack)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 248, in _split_test

self._join_test(t[0], t[1], stack)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 257, in _join_test

WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 95, in create

workflow_item.process(stack=stack)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 116, in process

if not self._execute(activity, stack):

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 162, in _execute

returned_action = self.wkf_expr_execute(activity)

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 313, in wkf_expr_execute

return self.wkf_expr_eval_expr(activity['action'])

File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr

result = eval(line, env, nocopy=True)

File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 314, in safe_eval

return eval(c, globals_dict, locals_dict)

File "", line 1, in <module>

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/account/account_invoice.py", line 927, in action_move_create

inv.with_context(ctx).write(vals)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api

result = method(self._model, cr, uid, self.ids, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/mail/mail_thread.py", line 432, in write

result = super(mail_thread, self).write(cr, uid, ids, values, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 372, in old_api

result = method(recs, *args, **kwargs)

File "/opt/odoo/addons/connector/connector/producer.py", line 62, in write

result = write_original(self, vals)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3787, in write

self._write(old_vals)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api

result = method(self._model, cr, uid, self.ids, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4039, in _write

recs.recompute()

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5732, in recompute

rec._write(values)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api

result = method(self._model, cr, uid, self.ids, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3898, in _write

cr.execute(query, params + (sub_ids,))

File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 158, in wrapper

return f(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/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)=(/, 1, 1, out_invoice) already exists.

" while evaluating

u'action_move_create()'

1
Avatar
Vazgeç
Avatar
Yogesh
En İyi Yanıt

Because in invoices, the combination of (number, company_id, journal_id, type)=(/, 1, 1, out_invoice) [is unique constraint] is supposed to be unique and number which is supposed to be auto-incremented is not generated. and you already have an invoice with the same combination so it is violating unique constraint. You should check journal sequence of invoice is okay or not it must generate a number and increment it every time.

0
Avatar
Vazgeç
Avatar
Travis Waelbroeck
En İyi Yanıt

For me, I found that there was an invoice who was assigned a number of "/" instead of a traditional invoice number.


From my understanding, the "/" is used as a placeholder for "next number in the sequence". Because that was already taken, no other invoices could be Validated.


The solution was to delete the bad invoice with the "/" invoice number (I had to delete a payment from it as well) and re-create it. Afterwards, I was able to validate normally.

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
invoice multiplication/duplication
invoice account.invoice duplicate
Avatar
Avatar
1
Mar 16
5212
Base Report Designer and Invoice File not working
invoice account.invoice
Avatar
Avatar
Avatar
3
Mar 15
5694
How to set default bank account for Customer on Invoices
invoice customer account.invoice
Avatar
Avatar
Avatar
3
Kas 24
5806
setting default value for account (invoice) Çözüldü
invoice account.invoice odoo8.0
Avatar
Avatar
Avatar
3
Ara 22
6856
Best way to warn user a supplier invoice is already entered (match on supplier invoice number) Çözüldü
invoice v7 duplicate
Avatar
1
Eyl 25
9723
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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