Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Cannot initialize DB in Odoo12

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
developmentinstallationdatabaseodoo12
2 Réponses
24902 Vues
Avatar
Jorge

Hi, when I try to initialize the DB I get the following errors:

$ python odoo-bin --addons-path=addons  -i base

....
2021-07-14 04:46:48,122 6452 INFO borch odoo.modules.loading: loading base/data/res.lang.csv 2021-07-14 04:46:48,185 6452 INFO borch odoo.modules.loading: loading base/data/res_lang_data.xml 2021-07-14 04:46:48,195 6452 INFO borch odoo.modules.loading: loading base/data/res_partner_data.xml 2021-07-14 04:46:48,339 6452 INFO borch odoo.modules.loading: loading base/data/res_company_data.xml 2021-07-14 04:46:48,359 6452 INFO borch odoo.modules.loading: loading base/data/res_users_data.xml 2021-07-14 04:46:48,570 6452 INFO borch odoo.modules.loading: loading base/data/report_paperformat_data.xml 2021-07-14 04:46:48,578 6452 INFO borch odoo.modules.loading: loading base/data/res_currency_data.xml 2021-07-14 04:46:48,981 6452 INFO borch odoo.modules.loading: loading base/data/res_country_data.xml 2021-07-14 04:46:50,597 6452 INFO borch odoo.modules.loading: loading base/data/ir_demo_data.xml 2021-07-14 04:46:50,625 6452 ERROR borch odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')ERROR: relation "ir_module_module" does not existLINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... ^ 2021-07-14 04:46:50,625 6452 ERROR borch odoo.modules.registry: Failed to load registry Traceback (most recent call last): File "/home/borch/odoo/odoo/models.py", line 1128, in _validate_fields check(self) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 343, in _check_xml view_arch = etree.fromstring(view.arch.encode('utf-8')) File "src/lxml/etree.pyx", line 3213, in lxml.etree.fromstring File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument File "src/lxml/parser.pxi", line 1765, in lxml.etree._parseDoc File "src/lxml/parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError File "", line 24lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 24, column 9
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.exceptions.ValidationError: ('Error while validating constraint\n\nExtra content at the end of the document, line 24, column 9', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/borch/odoo/odoo/modules/loading.py", line 360, in load_modules loaded_modules, processed_modules = load_module_graph( File "/home/borch/odoo/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/home/borch/odoo/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/home/borch/odoo/odoo/tools/convert.py", line 802, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/home/borch/odoo/odoo/tools/convert.py", line 865, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 761, in parse pycompat.reraise( File "/home/borch/odoo/odoo/tools/pycompat.py", line 86, in reraise raise value.with_traceback(tb) File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.tools.convert.ParseError: "Error while validating constraint
Extra content at the end of the document, line 24, column 9None" while parsing /home/borch/odoo/odoo/addons/base/data/ir_demo_data.xml:9, near ir.demo.form ir.demo

  Danger Zone

Demo data should only be used on test databases! Once they are loaded, they cannot be removed!

Please confirm that you want to irreversibly make this database a demo database.



During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/modules/registry.py", line 88, in new odoo.modules.reset_modules_state(db_name) File "/home/borch/odoo/odoo/modules/loading.py", line 556, in reset_modules_state cr.execute( File "/home/borch/odoo/odoo/sql_db.py", line 148, in wrapper return f(self, *args, **kwargs) File "/home/borch/odoo/odoo/sql_db.py", line 225, in execute res = self._obj.execute(query, params)psycopg2.errors.UndefinedTable: relation "ir_module_module" does not existLINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... ^
2021-07-14 04:46:50,627 6452 CRITICAL borch odoo.service.server: Failed to initialize database `borch`. Traceback (most recent call last): File "/home/borch/odoo/odoo/models.py", line 1128, in _validate_fields check(self) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 343, in _check_xml view_arch = etree.fromstring(view.arch.encode('utf-8')) File "src/lxml/etree.pyx", line 3213, in lxml.etree.fromstring File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument File "src/lxml/parser.pxi", line 1765, in lxml.etree._parseDoc File "src/lxml/parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError File "", line 24lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 24, column 9
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.exceptions.ValidationError: ('Error while validating constraint\n\nExtra content at the end of the document, line 24, column 9', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/borch/odoo/odoo/modules/loading.py", line 360, in load_modules loaded_modules, processed_modules = load_module_graph( File "/home/borch/odoo/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/home/borch/odoo/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/home/borch/odoo/odoo/tools/convert.py", line 802, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/home/borch/odoo/odoo/tools/convert.py", line 865, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 761, in parse pycompat.reraise( File "/home/borch/odoo/odoo/tools/pycompat.py", line 86, in reraise raise value.with_traceback(tb) File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.tools.convert.ParseError: "Error while validating constraint
Extra content at the end of the document, line 24, column 9None" while parsing /home/borch/odoo/odoo/addons/base/data/ir_demo_data.xml:9, near ir.demo.form ir.demo
  Danger Zone

Demo data should only be used on test databases! Once they are loaded, they cannot be removed!

Please confirm that you want to irreversibly make this database a demo database.



During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/service/server.py", line 1164, in preload_registries registry = Registry.new(dbname, update_module=update_module) File "/home/borch/odoo/odoo/modules/registry.py", line 88, in new odoo.modules.reset_modules_state(db_name) File "/home/borch/odoo/odoo/modules/loading.py", line 556, in reset_modules_state cr.execute( File "/home/borch/odoo/odoo/sql_db.py", line 148, in wrapper return f(self, *args, **kwargs) File "/home/borch/odoo/odoo/sql_db.py", line 225, in execute res = self._obj.execute(query, params)psycopg2.errors.UndefinedTable: relation "ir_module_module" does not existLINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... ^

I have already created the database using the following commands:

$ sudo -u postgres createuser -s $USER
$ createdb $USER

Instructions from here: https://www.odoo.com/documentation/12.0/administration/install.html#id7


I can connect with the database without any issues:
$ psql 

psql (11.12 (Debian 11.12-0+deb10u1))Type "help" for help.
borch=# 

Already installed all requirements. Is there something I am missing? Thanks.


0
Avatar
Ignorer
Jorge
Auteur

Hi Rajprasad, I recreated the DB and tried to initialize again but I got the same problem:

(.venv) borch@g4560:~/odoo$ dropdb borch

(.venv) borch@g4560:~/odoo$ createdb odoodb

(.venv) borch@g4560:~/odoo$ psql

psql: FATAL: database "borch" does not exist

(.venv) borch@g4560:~/odoo$ psql odoodb

psql (11.12 (Debian 11.12-0+deb10u1))

Type "help" for help.

odoodb=# \l

odoodb=# exit

(.venv) borch@g4560:~/odoo$ python3 odoo-bin --addons-path=addons -d odoodb -i base

es.loading: loading base/data/ir_demo_data.xml

2021-07-14 14:14:19,452 14647 ERROR odoodb odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')

ERROR: relation "ir_module_module" does not exist

LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...

^

2021-07-14 14:14:19,452 14647 ERROR odoodb odoo.modules.registry: Failed to load registry

Avatar
Rajprasad Joshi
Meilleure réponse

Hi Jorge,

Try with the below commands:
1) Create a new database:
    createdb #database name
2) Run using python3 instead of python and add newly created db in terminal
    python3 odoo-bin --addons-path=addons  -d #database name -i base

Regards,
RPJ

4
Avatar
Ignorer
Avatar
Mustaq Ahmed
Meilleure réponse

The working configuration for ODOO14 docker compose is as follows

docker-compose:::

version: '2'
services:
web:
image: odoo:14.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
db:
image: postgres:10
environment:
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- POSTGRES_DB=odoodb
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
odoo-web-data:
odoo-db-data:


odoo.conf in /config folder

[options]
admin_passwd = yoursecret
db_host = db
db_name = odoodb
db_port = 5432
db_user = odoo
db_password = odoo
addons_path = /mnt/extra-addons,/mnt/enterprise
proxy_mode = True
data_dir = /var/lib/odoo

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Odoo OpenERP Server Error Traceback (most recent call last):
development installation database odoo8
Avatar
0
juin 16
11521
How to reset the development database Résolu
development database
Avatar
Avatar
Avatar
2
août 25
3100
how to install sassc? Résolu
installation odoo12
Avatar
Avatar
Avatar
Avatar
Avatar
12
juil. 24
81180
Restore backup to postgresql for odoo
development database pgadmin
Avatar
0
nov. 24
50
Database selector for on-premises instance first setup
development setup database
Avatar
0
avr. 22
109
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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