← Back to team overview

openerp-india team mailing list archive

[Bug 1091184] [NEW] Importing csv file with children of existing parent gives error

 

Public bug reported:

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_id/id,name
cat_bevestiging,product.cat0,Bevestiging
cat_elektra,product.cat0,Elektra
cat_gereedschap,product.cat0,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.

** Affects: openobject-server
     Importance: Undecided
         Status: New


** Tags: csv import parent

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1091184

Title:
  Importing csv file with children of existing parent gives error

Status in OpenERP Server:
  New

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_id/id,name
  cat_bevestiging,product.cat0,Bevestiging
  cat_elektra,product.cat0,Elektra
  cat_gereedschap,product.cat0,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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1091184/+subscriptions


Follow ups

References