Importing csv file with children of existing parent gives error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Medium
|
OpenERP's Framework R&D | ||
Therp Backports (Deprecated) |
Fix Released
|
Medium
|
Ronald Portier (Therp) | ||
Server-6.1 |
Fix Released
|
Undecided
|
Unassigned | ||
Server-7.0 |
New
|
Undecided
|
Unassigned |
Bug Description
I have a csv files with product categories, that should be linked to the main category (the one with xml ID cat0). I try to import the csv file trough the user interface. This results in in error, saying that None can not be linked to an int.
The csv file looks like this:
id,parent_
cat_bevestiging
cat_elektra,
cat_gereedschap
The import creates the first record (committed to the database), then returns an error, and the rest of the import fails.
So apart from the original error, there is the error that a partial import is committed.
The error occurs during computation of the parent_left, parent_right values. Because the main category, does not have parent_left or parent_right set in the database. (I think this is an error too, by the way).
The import error can be easily solved by patching one line in orm.py.
Related branches
- Stefan Rijnhart (Opener) (community): Approve
-
Diff: 12 lines (+1/-1)1 file modifiedopenerp/osv/orm.py (+1/-1)
Changed in therp-backports: | |
status: | New → Fix Committed |
importance: | Undecided → Medium |
assignee: | nobody → Ronald Portier (Therp) (rportier1962) |
milestone: | none → 6.1-maintenance |
Changed in therp-backports: | |
status: | Fix Committed → Fix Released |
Changed in therp-backports: | |
milestone: | 6.1-maintenance → 7.0-maintenance |
Changed in therp-backports: | |
milestone: | 7.0-maintenance → none |
Improved patch, with only the changes necesarry