Hi,

I'm trying to setup a link between TinyERP 4.2.3.3 and Virtuemart 1.0.12, using 
the Axelor component. 
Installation seems to work fine, but I'm having trouble when importing the data 
from the website into Tiny (payment methods, categories etc). 

I'm getting errors like "'utf8' codec can't decode bytes in position 19-21: 
invalid data".

Details:

Traceback (most recent call last):
  File "netsvc.pyo", line 200, in _dispatch
  File "service\web_services.pyo", line 366, in execute
  File "osv\osv.pyo", line 111, in execute
  File "osv\osv.pyo", line 92, in execute_cr
  File "C:\Program Files (x86)\TinyERP 
Server\addons\virtuemart_interface\esale_vmart.py", line 133, in 
get_payment_methods
  File "xmlrpclib.pyo", line 1147, in __call__
  File "xmlrpclib.pyo", line 1437, in __request
  File "xmlrpclib.pyo", line 1201, in request
  File "xmlrpclib.pyo", line 1335, in _parse_response
  File "xmlrpclib.pyo", line 817, in end
  File "xmlrpclib.pyo", line 864, in end_string
  File "xmlrpclib.pyo", line 164, in _decode
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 19-21: 
invalid data

I've been able to narrow it down to trouble due to french accentuated 
characters (like 'é') being present in the names on the website. For example, 
if I remove all those characters from all payment type names, I can then import 
the payment types successfully. 
The problem is that as the store is in French there are such characters all 
over the place, and they can't be removed in all category names, product names, 
orders etc. 

This doesn't sound like an overly complicated thing, but my experience in web 
programming is nil so I have no idea where to look at. Does someone have an 
idea?

Here's the code for one of the functions that fail in the server component:


def get_payment_methods(self, cr, uid, ids, *args):
      for website in self.browse(cr, uid, ids):
         server = 
xmlrpclib.ServerProxy("%s/tinyerp-synchro.php" % website.url)
         payment_methods = 
server.get_payment_methods()
         payment_method_pool = 
self.pool.get('esale_vmart.paytype')
         for payment_method in 
payment_methods:
            value={
                 
 'web_id'      : website.id,
                 
 'esale_vmart_id'   : payment_method[0] ,
                 
 'name'      : payment_method[1]
            }
            existing = 
payment_method_pool.search(cr, uid, [('web_id','=',website.id), 
('esale_vmart_id', '=', payment_method[0])])
            if 
len(existing)>0:
              
 payment_method_pool.write(cr, uid, existing, value)
            else:
              
 payment_method_pool.create(cr,uid,value)

         #end for payment_method in 
payment_methods:
      #end for website in self.browse(cr, uid, 
ids):
      return True



Thanks




-------------------- m2f --------------------

--
http://www.openerp.com/forum/viewtopic.php?p=25455#25455

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to