[6.RC2] Account chart wizard does not check if generated account code for bank journal exsits

Bug #684119 reported by Nicolas Bessi - Camptocamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

[6.RC2] Account chart wizard does not check if generated account code for bank journal exsits.
So It may append that this piece of code :

 #create the account_account for this bank journal
             tmp = line.acc_name
             dig = obj_multi.code_digits
             if ref_acc_bank.code:
                 try:
                    new_code = str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num)
                 except:
                    new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num)
             vals = {

Generate a account code that does already exists

Related branches

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

As the account code as a unique constraint the wizard crash.

Regards

Nicolas

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
qdp (OpenERP) (qdp)
Changed in openobject-addons:
milestone: none → 6.0-rc2
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello Nicolas,

I have checked the scenario and it seems you are right.
If we have already configure X company's Chart then wizard crash with error "The code of the account must be unique per company !". You want we should raise error on the Account chart wizard if the company is has already some account chart installed ?
give me your suggestion please.

Thank you,
mra

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello Nicolas,

We have improved the chart of account wizard such that now it will not display the companies which are already configured .So it is commited on Addons3 branch with revision_id: mra@mra-laptop-20101224125947-lgw0mhlbb4kw2226 ..

Thank you,
Mustufa(mra)

Changed in openobject-addons:
status: In Progress → Fix Released
Revision history for this message
qdp (OpenERP) (qdp) wrote :

I'm reopening this bug that was closed a little too fast.

The error occurs when you enter a bank account in the wizard that generates your chart of account from template, if and only if the padding selected generates you a code for that bank account.account that is already used in the COA for that company. That will be the case for most of l10n_xx modules if you set a padding of 0.

In order to fix that, iterate untill you find a valid number not yet taken.
Thanks,
Quentin

Changed in openobject-addons:
status: Fix Released → Confirmed
Changed in openobject-addons:
milestone: 6.0-rc2 → none
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello Nicolas Bessi,

Its fixed in lp:~openerp-dev/openobject-addons/trunk-bug-684119-ara branch. It will be merge soon with trunk addons.

Revision ID: <email address hidden>
Revision No: 4572

Thanks,
ara

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
milestone: none → 6.1
qdp (OpenERP) (qdp)
Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.