Closed GoogleCodeExporter closed 8 years ago
Sorry, I mean stopping and restarting the OpenERP Server, not the Database :(
Original comment by stefan.peter.reinhardt@googlemail.com
on 5 Dec 2010 at 11:05
and me again ... I tried the import again with a new test installation. Here is
the uotput, maybe is helpful?
Environment Information :
System : Linux-2.6.35-23-generic-pae-i686-with-Ubuntu-10.10-maverick
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick
Operating System Release : 2.6.35-23-generic-pae
Operating System Version : #41-Ubuntu SMP Wed Nov 24 10:35:46 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : de_DE.UTF8
Python Version : 2.6.6
OpenERP-Client Version : 5.0.14
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call
last):
File "/usr/share/pyshared/openerp-server/netsvc.py", line 256, in dispatch
result = LocalService(service_name)(method, *params)
File "/usr/share/pyshared/openerp-server/netsvc.py", line 76, in __call__
return getattr(self, method)(*params)
File "/usr/share/pyshared/openerp-server/service/web_services.py", line 638, in execute
return self._execute(db, uid, wiz_id, datas, action, context)
File "/usr/share/pyshared/openerp-server/service/web_services.py", line 618, in _execute
return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
File "/usr/share/pyshared/openerp-server/wizard/__init__.py", line 178, in execute
res = self.execute_cr(cr, uid, data, state, context)
File "/usr/share/pyshared/openerp-server/wizard/__init__.py", line 153, in execute_cr
next_state = result_def['next_state'](self, cr, uid, data, context)
File "/usr/share/pyshared/openerp-server/addons/sneldev_magento.zip/sneldev_magento/wizard/sneldev_magento_products_import.py", line 40, in do_products_import
if (self.pool.get('sneldev.magento').import_products(cr, uid) < 0):
File "/usr/share/pyshared/openerp-server/addons/sneldev_magento.zip/sneldev_magento/sneldev_magento.py", line 522, in import_products
if info_product['weight']:
KeyError: 'weight'
Original comment by stefan.peter.reinhardt@googlemail.com
on 5 Dec 2010 at 12:32
Hi,
it seems that the developer assumed that products in Magento always have a
price and a weight. This is not always the case, but no error checking is done,
so you get the KeyError. I am not a Python specialist, but I got my 'no price'
products to import by changing the file 'sneldev_magento.py'.
Replace this section:
if info_product['price']:
product['list_price'] = info_product['price']
if info_product['weight']:
product['weight'] = info_product['weight']
(in my version around line 520) with this section:
try:
product['list_price'] = info_product['price']
except:
product['list_price'] = '0.00'
try:
product['weight'] = info_product['weight']
except:
product['weight'] = '0.00'
It should now import products with no weight and no price and give them a
weight and price of 0.00 in OpenErp.
Arnold.
Original comment by raptob...@gmail.com
on 3 Jan 2011 at 2:18
This will be integrated in 0.7.7
Original comment by sneldev@gmail.com
on 16 Jan 2011 at 4:38
Original issue reported on code.google.com by
stefan.peter.reinhardt@googlemail.com
on 5 Dec 2010 at 8:03