Either I'm stupid, or I'm really the first, who sets up the accounting from scratch without using a localization module in odoo 8.
Because the Swiss localization with almost 2000 accounts is much too bloated for small companies and is also lacking of translations, I started to create a complete set of accounts and tax templates myself.
This is, what I did:
- Created a new database, without demo data, multi-company setup.
- Installed multi-language chart of accounts, but no localization module.
- Created a new empty company and a new empty chart of accounts template
- Created account templates for a complete chart of accounts, the templates are correct and the codes are unique.
- Created all tax templates, tax codes and fiscal positions.
- I have deleted all account and account templates data from the original "Your company", which were possibe to delete because of the constraints.
Then I tried to create the chart of accounts using my own, properly set-up accounts templates and I receive the Constraint Error "The code of the account must be unique per company !".
I have checked the chart of accounts, the accounts, everything is empty, no accounts are setup. I have checked the database where company-id and account-code build a combined key, but there are no account records, the accounts table is empty and therefore it is impossible that duplicate entries could create a cconstraint error.
This are the logs:
First error:
2014-12-03 22:16:10,434 2691 ERROR P2Swiss openerp.sql_db: bad query: INSERT INTO "account_account" ("id", "currency_id", "code", "reconcile", "name", "level", "company_id", "user_type", "shortcut", "note", "parent_id", "currency_mode", "active", "type", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('account_account_id_seq'), NULL, '106000', false, 'Shortterm securities', 4, 1, 6, NULL, NULL, 113, 'current', true, 'liquidity', 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
Traceback (most recent call last):
File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
IntegrityError: duplicate key value violates unique constraint "account_account_code_company_uniq"
DETAIL: Key (code, company_id)=(106000, 1) already exists.
Second error:
2014-12-03 22:16:06,380 2513 WARNING P2Swiss openerp.models: Cannot execute name_search, no _rec_name defined on account.config.settings
2014-12-03 22:16:10,434 2691 ERROR P2Swiss openerp.sql_db: bad query: INSERT INTO "account_account" ("id", "currency_id", "code", "reconcile", "name", "level", "company_id", "user_type", "shortcut", "note", "parent_id", "currency_mode", "active", "type", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('account_account_id_seq'), NULL, '106000', false, 'Shortterm securities', 4, 1, 6, NULL, NULL, 113, 'current', true, 'liquidity', 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
Traceback (most recent call last):
File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
IntegrityError: duplicate key value violates unique constraint "account_account_code_company_uniq"
DETAIL: Key (code, company_id)=(106000, 1) already exists.
As I said, the account table is empty, there is no account code 106000 (which is anyway an account from the "Your Company".
Please someone tells me that I'm not stupid, but only the first. Should I post this as an issue and what can I do to receive the appropriate attention as this would be a severe and major issue, especially for Switzerland, where no usable accounting localization for small companies is available (sorry, camp2camp, but I'm willing to contribute!).
And what can I do as a fast, but reusable workaround, I need to have setup a working chart of account by Monday next week the latest?
It seems to be a bug, I have opened an issue in github: https://github.com/odoo/odoo/issues/4058
@Ermin, Thanks, i'll keep an eye on that github issue for any response from Odoo. Have you managed to reproduce this on an instance outside of a Bitnami stack? The fact it is running inside Bitnami is likely to be completely unrelated to the issue you are facing, however it would be interesting to test this just installing from source. Could you provide me with details about how you installed your Odoo 8.0 instance, as well as PostgreSQL version, OS version, etc? I would like to try and setup a development environment that mirrors yours so that I can try to reproduce myself and confirm this as a bug.
@Luke: I launched a Bitnami 64bit HVM AWS image on a 64bit AWS Ubuntu 14.04 micro instance. Postgres is: "PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14), 64-bit"
I was so frustrated because I've lost about 25 hours setting up an accounting system in 4 languages, I've never tried it again. I, for myself, am not experienced enough to setup my own "native" installation.