Analytic Account Code sequence not working

Bug #734077 reported by Jean-Paul
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Fresh installation of OpenERP 6.0.1 stable, modules analytic and account_accountant installed).
Add admin user to the group "Useability / Analytic Accounting".

Go to Accounting > Configuration > Analytic Accounting > Analytic Accounts
Click "New" and fill in minimum of required fields, save the record.

Field "Account Code" stays empty. Expected behavior: it should have value 2708 (that's the next number for this sequence in a default installation).

Working with many analytic accounts becomes messy without this automated sequence.

Alan Bell (alanbell)
Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello ,

I have checked your issue. I could not a found the account code as a sequence field in account.analytic.account object.
Account code is a char field in account.analytic.account object so it is not generating automatically.

So would you please elaborate with more information or provide the screen-shot where you faced the problem.

Thanks.

Changed in openobject-addons:
status: Confirmed → Incomplete
Revision history for this message
Alan Bell (alanbell) wrote :

I think that is the issue really, it should be a sequence not a char field (I think). There is a sequence counter set up for it, starting at 2708 for some reason, but it isn't a sequence field. Analytic accounts get set up automatically when you create a project and they end up unnumbered which isn't ideal.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

Can not consider this issue as a generalize way like accounting terms any one can change or assign code filed by them-shelf.
We can consider same issue like general account code.

So I am closing this issue.

Thanks.

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
Jean-Paul (jpvewijk) wrote :

Can someone explain to me when and why this functionality was removed since V4? If it was removed intentionally, this is not a bug. If it disappeared by accident, this is a bug. I cannot find anything about it in the release notes.

In V4, if you add an analytic account manually as described in this bug, Account Code gets a value and the value of the sequence in Administration > Configuration > Sequences > Analytic account sequence is increased accordingly.

In in V4, if you create an analytic account hierarchy, the account code reflects this automatically: You get account codes like
View account: Description: client X, code: 2708
View account: Description: client X main actvity Y, 2708 - 001
Normal account:Description: client X, main activity Y, sub activity Z, 2708 - 001 - 001

The codes are extremely valuable when searching and compiling reports from time sheet lines, generating subtotals per subactivity etc.

Manually generating them is error prone.

Revision history for this message
Jean-Paul (jpvewijk) wrote :

I think I found the code that was removed. Module project (project.py), class account_analytic_account, in V4:

class account_analytic_account(osv.osv):
        _name = 'account.analytic.account'
        _description = "Analytic Accounts"
<snip>
        def create(self, cr, uid, vals, context=None):
                parent_id = vals.get('parent_id', 0)
                if ('code' not in vals or not vals['code']) and not parent_id:
                        vals['code'] = self.pool.get('ir.sequence').get(cr, uid, 'account.analytic.account')
                return super(account_analytic_account, self).create(cr, uid, vals, context=context)

Same method in V6:

    def create(self, cr, uid, vals, context=None):
        if context is None:
            context = {}
        if vals.get('child_ids', False) and context.get('analytic_project_copy', False):
            vals['child_ids'] = []
        return super(account_analytic_account, self).create(cr, uid, vals, context=context)

If this is not considered a bug, I might create a module to reintroduce this functionality.

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.