← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 656370] Re: Upload image and import orders fail

 

I got this branch for the same reason "mature" status. So the partner management is better for sure.
When I will get more time I propose some modification to avoid these issue.

For now, could check your file "sale.py" I added 2 lines before calling "find_or_create" function?
 
    def get_order_addresses(self, cr, uid, res, external_referential_id, data_record, key_field, mapping_lines, defaults, context):
        partner_obj = self.pool.get('res.partner')
        partner_address_obj = self.pool.get('res.partner.address')
        del(data_record['billing_address']['parent_id'])
        if 'parent_id' in data_record['shipping_address']:
            del(data_record['shipping_address']['parent_id'])

        #Magento uses to create same addresses over and over, try to detect if customer already have such an address (Magento won't tell it!)
        #We also create new addresses for each command here, passing a custom magento_id key in the following is what
        #avoid the base_external_referentials framework to try to update existing partner addresses
        data_record['billing_address'].update(self.get_mage_customer_address_id(data_record['billing_address']))
        if 'address_type' in data_record['shipping_address']:
            data_record['shipping_address'].update(self.get_mage_customer_address_id(data_record['shipping_address']))
        shipping_default = {}
        billing_default = {}

+       # add by Nico74
+        address_default = {}

        if res.get('partner_id', False):
            shipping_default = {'partner_id': res.get('partner_id', False)}
        billing_default = shipping_default.copy()

+        # add by Nico74
+        address_default = billing_default

        billing_default.update({'email' : data_record.get('customer_email', False)})
        inv_res = partner_address_obj.find_or_create(cr, uid, data_record['billing_address'], external_referential_id, address_default, context)
        if 'address_type' in data_record['shipping_address']:
            ship_res = partner_address_obj.find_or_create(cr, uid, data_record['shipping_address'], external_referential_id, address_default, context)

-- 
Upload image and import orders fail
https://bugs.launchpad.net/bugs/656370
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in Magento Open ERP Connector: New

Bug description:
Dear all

My Name is Mutunga

I have installed OpenERP version 5 and Magento. I have also installed and configured my magentoerpconnect with my magento shop setting and followed the instructions.

I am able to synchronize referential settings and import product categories , attributes, attribute sets etc. I am also able to export catalog from the magento shop actions.

However when I try Update images i get the following error

Environment Information : 
System : Windows-XP-5.1.2600-SP2
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : en_US.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 5.0.12
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 256, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 76, in __call__
    return getattr(self, method)(*params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 577, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 58, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/sale.py", line 64, in export_images
    res = self.pool.get('product.images').update_remote_images(cr, uid, recent_changed_images, ctx)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/product_images.py", line 96, in update_remote_images
    'mime':each.filename and mimetypes.guess_type(each.filename)[0] or 'image/jpeg',
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/magerp_osv.py", line 53, in call
    res = self.ser.call(self.session, method, arguments)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
Fault: <Fault 104: 'Cannot create image.'>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Also when I try to import products i get the following error


Environment Information : 
System : Windows-XP-5.1.2600-SP2
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : en_US.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 5.0.12
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 256, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 76, in __call__
    return getattr(self, method)(*params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 577, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 58, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base_sale_multichannels/sale.py", line 216, in import_orders
    self.import_shop_orders(cr, uid, shop, defaults, ctx)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/sale.py", line 113, in import_shop_orders
    'ids_or_filter':ids_or_filter
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/magerp_osv.py", line 236, in mage_import_base
    rec_result = self.ext_import(cr, uid, rec_data, external_referential_id, defaults, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base_external_referentials/external_osv.py", line 167, in ext_import
    vals = self.oevals_from_extdata(cr, uid, external_referential_id, each_row, for_key_field, mapping_lines, defaults, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/sale.py", line 305, in oevals_from_extdata
    res = self.get_order_addresses(cr, uid, res, external_referential_id, data_record, key_field, mapping_lines, defaults, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect/sale.py", line 245, in get_order_addresses
    vat = data_record['customer_taxvat'].translate(allchars, delchars).upper()
AttributeError: 'NoneType' object has no attribute 'translate'


Can anyone help.





Follow ups