devendrapathi / sneldev-magento-openerp

Automatically exported from code.google.com/p/sneldev-magento-openerp
0 stars 1 forks source link

Import Product Problem probably coz Products without field "weight" "Käuferschutz / Trusted Shop" #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make an special product in Magento (an Insurance) "Käuferschutz", which has 
no Field "Weight" (many other fields are also not there......) .. I don't no 
how to make it, coz this was alreaedy there (they was installed by the Module 
German_market_ready)
2. Import with OpenERP
3. Import breaks, becaus Field Weight

What is the expected output? What do you see instead?
Import successful ;)

What version of the product are you using? On what operating system?
0.76

Please provide any additional information below.
Theese products are from TrusedShops and they are default, I cannot change them 
:( .. 
After the Import break is happen, no import is anymore possible until i stop 
and restart the database.
And my current solution (only i a tet environment, i don't want to try it in 
prdocution environment)
Make an backup from Magento, drop all inusrance products in Magento, import 
with openERP, restore Magento .... and now no Import Error, but the Insurance 
Products are not at OpenERP ... (is there anewhere a log file?) However, I am 
not sure is the import now OK ... so I want to wait for your answer, I hope is 
OK ;)

Is it possible to import such kind of "Special Products" or is it possible to 
ignore them during the Import? Whatever each solution would be OK.

Many thanks in advance

Best regards
Stefan

Sorry for the englich, is something wrong or impolite, then please excuse it!!

Original issue reported on code.google.com by stefan.peter.reinhardt@googlemail.com on 5 Dec 2010 at 8:03

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
This will be integrated in 0.7.7

Original comment by sneldev@gmail.com on 16 Jan 2011 at 4:38