Odoo Help


xml code to implement new chart account

on 5/16/18, 6:53 AM 225 views

Here below is the code used to implement a new chart account.

Everything works fine :

<?xml version="1.0" encoding="utf-8"?>
    <data noupdate="1">

         <record id="l10n_fr_custom.1_pcg_701" model="account.account">
            <field name="name">Ventes de produits TVA NP</field>
            <field name="code">70100000</field>
            <field name="user_type_id" ref="account.data_account_type_revenue"/>


But when I update the whole code, appears an error :

odoo.sql_db: bad query: b'INSERT INTO "account_account" ("id", "deprecated", "code", "name", "reconcile", "company_id", "user_type_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval(\'account_account_id_seq\'), false, \'70100000\', \'Ventes de produits TVA NP\', false, 1, 14, 1, 1, (now() at time zone \'UTC\'), (now() at time zone \'UTC\')) RETURNING id'
ERROR: duplicate key value violates unique constraint "account_account_code_company_uniq"
DETAIL:  Key (code, company_id)=(70100000, 1) already exists.

How am I supposed to resolve this ?

Your log says the error and its more detailed

Hilar AK
on 5/16/18, 10:26 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/16/18, 6:53 AM
Seen: 225 times
Last updated: 5/16/18, 10:51 AM