import bug and fix

Bug #659891 reported by Leigh Willard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Dhruti Shastri(OpenERP)

Bug Description

During the import of a chart of accounts, the parent name can have spaces in it, for example "Balance Sheet". But the import function chops the string and does a search just on the first word ex. "Balance", instead of using the entire string.

FIX:
In function account.account, function name_search,

 if not ids and len(name.split()) >= 2:
                ids = self.search(cr, user, [('code', operator, name.split()[0]), ('name', operator, ' '.join(name.split()[1:]))]+ args, limit=limit)

Changed in openobject-addons:
assignee: nobody → DHS(OpenERP) (dhs-openerp)
Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Leigh,

After having a check with the code , it seems that there is no bug in the code.

In general the name of the account starts with the code and then its name. i.e. 403000 Entreprises liées

Now when you search an account name,
         first it will compare with the code , if code matches result is returned.
         If no match found in the code then it will search in the name.

If neither the code nor the name matches the supplied string, OpenERP separated the string with space as a combination of code + SPACE + name

I hope this makes it pretty clear.

Thanks.

Changed in openobject-addons:
milestone: none → 5.0.15
milestone: 5.0.15 → 6.0
status: New → Invalid
Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

I would like to add :

If neither the code or the name matches the supplied string, OpenERP separates the string with space as a combination of code + SPACE + name and performs the search as first split with code an another with name.

Thanks.

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.