← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 697129] Re: import error in v6rc2

 

The exposed situation seems not to be a bug in the server directly but
is arguably a bit difficult.

In 'import compatible' mode, the client (gtk or web), not the server can
choose which fields are exportable or not. In this case, while 'import
compatible' is correctly checked, it is still possible to export data
that the import mechanism won't be able to process (for good reason, for
instance a field is read-only).

One of those reason concerns fields that are relationships to other
objects. That is, fields with a '+' in the GUI. The exported value of
those field is usually computed from the values of the object it points
to. Although it is nice, it is difficult to do the opposite processing:
parse a single field and update the corresponding data in the object.

As an example, you can export the 'Contacts' field. Its value will be a
concatenation of the street, the contact name and other things. But on
the other hand, it is clear that it is not possible to update the
individual fields of an Address just by giving a single value.

So the problem is really in the GUI which doesn't really honor what
'import compatible' should mean. A bug was filled against the client to
change the situation. Another problem is the lack of thorough checking
at import time to report better error messages.

In the mean time, don't export the '+' fields as-is but only their sub-
fields.

When modifying an exported csv file to import it after, be sure to not
give Database IDs: those can be used if you want to modify the
associated data but not to create new data. Database IDs are assigned by
the system when data are created. If you need to refer to those data,
use a simple ID.

** Changed in: openobject-server
   Importance: High => Wishlist

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/697129

Title:
  import error in v6rc2

Status in OpenERP Server:
  In Progress

Bug description:
  hi,
  i am trying to manually migrate from v5.0.15 to v6.rc2.  i am trying by simple export and import method. is that wrong?

  anyway,i got some problems so i thought maybe i should familiarize
  with the process a little more.s i made a new database with demo data
  loaded in v6 and another configured but emty database .i tried to
  import/export in the same versions from loaded with demo data databse
  to the empty one.

  with this senario i got this exception.

  i go to address book in sales and export with these fields: account payable and recievable and the name. 
  i import this csv file in the empty database and everything is dandy.
   
  but as soon as i add contacts and contacts name,when i want to import it gives :
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/netsvc.py", line 489, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/service/web_services.py", line 598, in dispatch
      res = fn(db, uid, *params)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/osv/orm.py", line 858, in import_data
      process_liness(self, datas, [], current_module, self._name, fields_def, position=position)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/osv/orm.py", line 791, in process_liness
      res2 = process_liness(self, datas, prefix + [field[len(prefix)]], current_module, relation_obj._name, newfd, pos, first)
    File "/home/nima/Desktop/openerp-server-6.0.0-rc2/bin/osv/orm.py", line 767, in process_liness
      if field[len(prefix)]=='id':
  IndexError: list index out of range

  i don't get an idea what causes this error.



References