Odoo Help


Why Configuring Chart via WEB succeed and failed with XML (duplicate key for taxes)

Mind And Go
on 10/22/13, 6:53 AM 1,740 views

Hy folks,

I'm trying to configure all my charts through XML. I found this post http://help.openerp.com/question/507/is-it-possible-to-set-database-default-configuration-values/ that explain how to deal with wizard into xml. That was damned helpful.

So I tried this : 1 - Load my chart account :

record model="account.installer" id="at_account_init" > < field name="company_id" ref="base.main_company" / > < field name="charts" >l10n_fr< /field> < field name="date_start" >01/10/2013< /field> < field name="date_stop">30/09/2014< /field> < field name="period">month< /field> < /record> < function model="account.installer" name="execute" eval="[[ref('at_account_init')]]" / >

This part works fine.

2 - Then configure my accounting chart for my company through the wizard

< record model="wizard.multi.charts.accounts" id="at_multi_chart_init"> < field name="company_id" ref="base.main_company" /> < field name="chart_template_id" ref="l10n_fr.l10n_fr_pcg_chart_template" /> < field name="currency_id" ref="base.EUR" /> < field name="sale_tax" ref="l10n_fr.tva_normale" /> < field name="purchase_tax" ref="l10n_fr.tva_acq_normale" /> < field name="code_digits" eval="9" / > < /record> < function model="wizard.multi.charts.accounts" name="execute" eval="[[ref('at_multi_chart_init')]]" / >

This one failed with the following error :

IntegrityError: duplicate key value violates unique constraint "account_tax_name_company_uniq" DÉTAIL : Key (name, company_id)=(TVA déductible (achat) 20,0%, 1) already exists

I precise that when I do this through the web interface, it doesn't causes any problem.

I'm suspecting a bug https://bugs.launchpad.net/openobject-addons/+bug/871680 that is a duplicate of this one : https://bugs.launchpad.net/openobject-addons/+bug/876310

Mind And Go
On 5/28/14, 3:07 AM

I set a noupdate="1" attribute for the data node in the xml and it works like a charm.

Importing twice through XML is not a correct way of working

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

0 follower(s)


Asked: 10/22/13, 6:53 AM
Seen: 1740 times
Last updated: 3/16/15, 8:10 AM