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
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    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

Error in odoo 12 after restoring database, ProgrammingError: relation "ir_attachment_id_seq" does not exist

Abonare

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

Această întrebare a fost marcată
databasebackuprestorerestoredbodoo12
6 Răspunsuri
10092 Vizualizări
Imagine profil
José Luis Benitez

Hi, I got this error in odoo 12 after importing a database from a computer to another:

psycopg2.ProgrammingError: relation «ir_attachment_id_seq» does not exist
LINE 1: ...res_model", "type", "website_id") VALUES (nextval('ir_attach...
^
Error to render compiling AST
ProgrammingError: no existe la relación «ir_attachment_id_seq»
LINE 1: ...res_model", "type", "website_id") VALUES (nextval('ir_attach...
^
Template: website.layout
Path: /templates/t/t/t[5]/t[6]
Node:


------ SOLUTION --------


The error was because the original database was Postgres 10 but my local database is Postgres 9.6, the dump.sql file in the .zip file contains "to integer" in the script and Postgres 9.X doesn't support this operation.

To fix this error you need decompress the .zip file and edit the dump.sql deleting all the "to integer", after deleting all ocurrence compress all the files again and restore the backup.

If your dump.sql file is larger than 500 MB I recomend using a terminal text like nano or vim in linux to replace all the "as integer" ocurrencies to avoid overflowing your RAM memory



0
Imagine profil
Abandonează
Imagine profil
Pranav P S
Cel mai bun răspuns
  • Apparently there is a single statement that causes this when creating sequences, which is the "AS INTEGER" in every "CREATE SEQUENCE" which is not supported in PostgreSQL 9.6. To work around this, you need to unzip your backup file, open & edit your dump.sql file and delete every occurrence of "AS INTEGER" from every "CREATE SEQUENCE" statement. Then zip the contents again and try to restore one more time. It will work.

(Refered from stackoverflow)


1
Imagine profil
Abandonează
Imagine profil
Alexander Hilsum
Cel mai bun răspuns

This will do the job. Run in PGADMIN or commandline
remove -- to execute

DO $$
DECLARE
_record RECORD;
_max BIGINT;
_exec VARCHAR;

BEGIN

FOR _record IN
(
SELECT table_schema,
*
FROM information_schema.COLUMNS
WHERE column_name = 'id' and table_name != 'xxx')
LOOP
execute format('select max(id) from %s', _record.table_name) into _max;

IF _max is NULL THEN
_max = 1;
ELSE
_max = _max + 10;
END IF;

_exec = 'CREATE SEQUENCE IF NOT EXISTS ' || _record.table_name || '_id_seq START ' || _max;
RAISE INFO '%', _exec;

execute _exec;



END LOOP;
END;
$$ ;


1
Imagine profil
Abandonează
Imagine profil
Forcix BV
Cel mai bun răspuns

@Alexander Hilsum: Thanks a lot for your fix script. It helped me fix my DB with 50 missing indices in no time. I did add two lines to configure the sequence as default nextval on the column:


DO $$

DECLARE

_record RECORD;

_max BIGINT;

_exec VARCHAR;

_exec2 VARCHAR;


BEGIN


FOR _record IN

(

SELECT table_schema,

*

FROM information_schema.COLUMNS

WHERE column_name = 'id' and table_name != 'xxx')

LOOP

execute format('select max(id) from %s', _record.table_name) into _max;


IF _max is NULL THEN

_max = 1;

ELSE

_max = _max + 10;

END IF;


_exec = 'CREATE SEQUENCE IF NOT EXISTS ' || _record.table_name || '_id_seq START ' || _max;

RAISE INFO '%', _exec;


execute _exec;

_exec2 = 'alter table ' || _record.table_name || ' alter column id set default nextval(''' || _record.table_name || '_id_seq''::regclass)';

RAISE INFO '%', _exec2;

execute _exec2;


END LOOP;

END;

$$ ;

0
Imagine profil
Abandonează
Imagine profil
ASOP
Cel mai bun răspuns

This Solve:

CREATE SEQUENCE ir_attachment_id_seq START 1;

then 

SELECT setval('ir_attachment_id_seq', (SELECT MAX(id) FROM ir_attachment));

0
Imagine profil
Abandonează
Imagine profil
Oliver Breeden
Cel mai bun răspuns

I had a similar issue on a custom table that I had changed the name of.

The fix was to recreate the sequence in the database (through pgadmin or other database management tool)

My table was called 'sale_partexchange' so you can just replace the table name with your one and run the following SQL statement.

DROP SEQUENCE IF EXISTS sale_partexchange_id_seq;
CREATE SEQUENCE sale_partexchange_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;


0
Imagine profil
Abandonează
Imagine profil
nando
Cel mai bun răspuns

im having a pretty weird problem as well, when i try to go into "Technical -> sequencing" in order to change the sequence number of my invoices, i get inmediatly a server error, where it says

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/api.py", line 1039, in get
    value = self._data[key][field][record._ids[0]]
KeyError: 254

so i cannot change the invoice sequences, at the same time, checking the history of invoices, the sequence never changed the year from 2021, it stuck, right now begginning 2023, we have inv/2021/0001

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
Icons Doesn't Show After Restoring Database Rezolvat
database backup restore restoredb databasebackup
Imagine profil
Imagine profil
1
mar. 24
9354
how to restore database for different versions of Odoo? Rezolvat
database backup restore restoredb odoo
Imagine profil
Imagine profil
1
aug. 15
7933
Restore completes but database not visible Rezolvat
backup restore restoredb
Imagine profil
Imagine profil
Imagine profil
3
ian. 22
6163
Odoo 12 One app free Cloud Hosting Database Restore Problem
database backup restore
Imagine profil
Imagine profil
Imagine profil
2
sept. 19
4524
Error message in restoring database via both zip file and dump file for Odoo 8 Rezolvat
database backup restore
Imagine profil
Imagine profil
3
iun. 16
16368
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