constraint error: The code of the account must be unique per company

Asked by Thorsten Vocks (OpenBig.org)

Open ERP Version 5.0.1

I have a bug with new created module "l10n_chart_de_skr03"
Module Branch is
lp:~openerp-community/openobject-addons/l10n_chart_de_skr03

Reported Bug is:

The code of the account must be unique per company.

Under version 5.0.0 installation was successfull.
Are there changes between 5.0.0 and 5.0.1
depending the chart installation wizard?

regards and thanks in advance to help finish this
contribution.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Thorsten Vocks (OpenBig.org)
Solved:
Last query:
Last reply:
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#1

By the newer version,

We have put a constraint that the pair of code and company to the account must be unique.

It looks like, either the accounts have no code, or you try to create the account chart second time with the same company.

Thank you.

Revision history for this message
Thorsten Vocks (OpenBig.org) (openbig.org) said :
#2

Thanks,
i completed the code field of some
remaining "view" accounts.
This solved my problems.
Thanks for your help.

Regards
Thorsten

Revision history for this message
polgar (kovacs-endre) said :
#3

Hi Thorsten!

You can explain in more detail this solution? where should change the code?

here my first records:

 <record id="chart0" model="account.account.template">
  <field name="code">0</field>
  <field name="name">Account Chart</field>
  <field name="type">view</field>
  <field name="user_type" ref="l10n_chart_hu.account_type_view"/>
 </record>

<record id="chart1" model="account.account.template">
 <field name="code">1</field>
 <field name="reconcile" eval="False"/>
 <field name="parent_id" ref="chart0"/>
 <field name="type">view</field>
 <field name="user_type" ref="l10n_chart_hu.account_type_asset"/>
 <field name="name">BEFEKTETETT ESZKÖZÖK</field>
</record>

Thanks!

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#4

Hello Polgar,

Can you please check whether all the xml records in your file have different CODE field?
i.e., <field name="code">0</field>.
May be, you have no code field for some account templates.Its compulsory now.
If so,

Make sure you are creating chart for another company.

Thanks.

Revision history for this message
polgar (kovacs-endre) said :
#5

This chart of account it works well with previous openerp versions so i think i have no problems with code fields.
So installation of this chart works vell but when i want to generate chart of accounts from a Chart Template i get this error..
If i have x company i should "generate chart of accounts from a Chart Template" for y company?

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#6

Yes, exactly.
We have put a constraint that the pair of code and company to the account must be unique.

So , go for 'Y' company.

Revision history for this message
polgar (kovacs-endre) said :
#7

Thanks for help!

With the 'y' company with same error yet but i working on it

Revision history for this message
Harald Oehlmann (harald-oehlmann) said :
#8

I am quite stuck with the installation of the accounts using module "l10n_chart_de_skr03" doe to the described error.
Are there any diagnosis possibilities to find exactly where the duplicate or missing code field is ?

I have a clean database without demo data and nearly all tables are empty.
Only some account types are defined.

Thank you in advance,
Harald