Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

duplicate key Error while updating model

Odebírat

Get notified when there's activity on this post

This question has been flagged
5 Odpovědi
5893 Zobrazení
Avatar
Jack

we use Odoo Community Edition V12 since 1,5years now.

in a simple custom module we just changed a XML File.

Updating will be done by command-line "odoo -u CUSTOMMODULE -d DBNAME --config="PATH"

But suddenly we get this error while updating:

ERROR odoonew22 odoo.sql_db: bad query: b"INSERT INTO ir_model_fields (field_description,relation_table,copied,related,name,track_visibility,required,size,store,model,index,translate,state,on_delete,model_id,readonly,ttype,relation,column2,help,relation_field,column1,selectable) VALUES ('Pricelist Name', NULL, true, NULL, 'name', NULL, true, NULL, true, 'product.pricelist', false, true, 'base', NULL, 170, false, 'char', NULL, NULL, NULL, NULL, NULL, true),('Active', NULL, true, NULL, 'active', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, false, 'boolean', NULL, NULL, 'If unchecked, it will allow you to hide the pricelist without removing it.', NULL, NULL, true),('Pricelist Items', NULL, true, NULL, 'item_ids', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, false, 'one2many', 'product.pricelist.item', NULL, NULL, 'pricelist_id', NULL, true),('Currency', NULL, true, NULL, 'currency_id', NULL, true, NULL, true, 'product.pricelist', false, false, 'base', 'set null', 170, false, 'many2one', 'res.currency', NULL, NULL, NULL, NULL, true),('Company', NULL, true, NULL, 'company_id', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', 'set null', 170, false, 'many2one', 'res.company', NULL, NULL, NULL, NULL, true),('Sequence', NULL, true, NULL, 'sequence', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, false, 'integer', NULL, NULL, NULL, NULL, NULL, true),('Country Groups', 'res_country_group_pricelist_rel', true, NULL, 'country_group_ids', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, false, 'many2many', 'res.country.group', 'res_country_group_id', NULL, NULL, 'pricelist_id', true),('Discount Policy', NULL, true, NULL, 'discount_policy', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, false, 'selection', NULL, NULL, NULL, NULL, NULL, true),('ID', NULL, true, NULL, 'id', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, true, 'integer', NULL, NULL, NULL, NULL, NULL, true),('Display Name', NULL, false, NULL, 'display_name', NULL, false, NULL, false, 'product.pricelist', false, false, 'base', NULL, 170, true, 'char', NULL, NULL, NULL, NULL, NULL, false),('Created by', NULL, true, NULL, 'create_uid', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', 'set null', 170, true, 'many2one', 'res.users', NULL, NULL, NULL, NULL, true),('Created on', NULL, true, NULL, 'create_date', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, true, 'datetime', NULL, NULL, NULL, NULL, NULL, true),('Last Updated by', NULL, true, NULL, 'write_uid', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', 'set null', 170, true, 'many2one', 'res.users', NULL, NULL, NULL, NULL, true),('Last Updated on', NULL, true, NULL, 'write_date', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, true, 'datetime', NULL, NULL, NULL, NULL, NULL, true),('Last Modified on', NULL, false, NULL, '__last_update', NULL, false, NULL, false, 'product.pricelist', false, false, 'base', NULL, 170, true, 'datetime', NULL, NULL, NULL, NULL, NULL, false),('Priorit\xc3\xa4t', NULL, true, NULL, 'priority', NULL, false, NULL, true, 'product.pricelist', false, false, 'base', NULL, 170, false, 'integer', NULL, NULL, 'Die h\xc3\xb6chste Priorit\xc3\xa4t startet bei 100. Ist eine Preisliste auf einem Artikel nicht verf\xc3\xbcgbar wird die n\xc3\xa4chst h\xc3\xb6here Priort\xc3\xa4t gew\xc3\xa4hlt.', NULL, NULL, true) RETURNING id"
ERROR: FEHLER:  doppelter Schlüsselwert verletzt Unique-Constraint »ir_model_fields_name_unique«
DETAIL:  Schlüssel »(model, name)=(product.pricelist, active)« existiert bereits.
 
2020-10-13 16:20:03,482 63171 WARNING odoonew22 odoo.modules.loading: Transient module states were reset
2020-10-13 16:20:03,483 63171 ERROR odoonew22 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 60, in __new__
    return cls.registries[db_name]
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 69, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 44, in __getitem__
    a = self.d[obj].me
KeyError: 'odoonew22'


we did not change anything at model product.pricelist.

The Error MEssage is in german: it tells that Unique-Constraint »ir_model_fields_name_unique« is violated during the upper INSERT statement to ir_model_fields.


0
Avatar
Zrušit
Niyas Raphy (Walnut Software Solutions)

it will be better if you can add the code i which you made the change, also ensure the error is not there, if you revert the last change, as you are getting a unique constrains error, if you are changing some data files, try giving some another name etc

Jack
Autor

any hints how to fix this? we alreads reverted all changes and in testenvironment it works as expected with same Files and inserted DB-Dump

Jack
Autor

very strange..

select * from ir_model_fields where model LIKE 'product.pricelist%'

this givs us results where model is product_pricelist

BUT:

select * from ir_model_fields where model = 'product.pricelist'

this does not giv any results (although the upper query shows results with product.pricelist)

Jack
Autor

solution was: "vacuumdb -f DBNAME"

Avatar
Jack
Autor Nejlepší odpověď

we already reverted all change. (only added a field in a tree view of the custom module).

moreover we copied all sources and DB-Dump to another Server but there i do not get this duplicate insert error when updating the module. Maybe some DB-Issues?

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

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

Přihlásit se
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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