chart of account tree - unexpected behavior in sorting records
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Stephane Wirtel (OpenERP) |
Bug Description
I am building a new chart of account. In the account tree my items are not in sequence as
1
-->10
2
-->20
but are unexpectedly changing to
2
-->20
1
-->10
thus into the wrong sequence.
I have searched and found that the tablefield parent_left is calculated and used for ordering the data, but could not find how I can manually influence that behavior.
My only option is to create a XML in the right sequence so when installing the chart of account country module the table is populated in right sequence and the parent_left is calculated in sequence.
But when adding account records later on they don't fall in the right sequence.
This is a problem for countries where the chart of account is not fixed developed by the country administration like in The Netherlands or USA, where users start with a minimal chart of account and can add extra accounts later on when needed.
OpenERP RC3
Proposal for code change in:
/addons/
line 127
class account_
_order = "parent_left"
_name = "account.account"
to
class account_
_order = "code" #<<== changed order from "parent_left" to "code"
_name = "account.account"
I have tested this change and it gives the right behavior. All chart of accounts are sorted now based on "code" instead of "parent_left" resulting in a logical order of account number and/or alphabetic.
Changed in openobject-addons: | |
assignee: | nobody → qdp |
Changed in openobject-addons: | |
assignee: | qdp → stephane-openerp |
changed project from openobject-server to openobject-addons as it is specific in account module.