c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #03596
[Bug 538408] Re: c2c_contact_to_ldap : Bug and Encoding problem
** Changed in: openobject-addons
Status: Fix Committed => In Progress
--
c2c_contact_to_ldap : Bug and Encoding problem
https://bugs.launchpad.net/bugs/538408
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Addons Modules: In Progress
Bug description:
Hi everyone,
Before everything else, I want to thanks the team of camptocamp for this module that can concern many people.
I tested the module in success some weeks ago and it works very good. But unfortunately, there is some bugs in the last version.
The first is not in c2c_contact_to_ldap but in c2c_partner_address. At the installation we have the following error :
Environment Information :
System : Linux-2.6.31-19-generic-i686-with-Ubuntu-9.10-karmic
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
Operating System Release : 2.6.31-19-generic
Operating System Version : #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : fr_FR.UTF8
Python Version : 2.6.4
OpenERP-Client Version : 5.0.7
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/opt/5.0.7-0_openerp/server/bin/netsvc.py", line 244, in dispatch
result = LocalService(service_name)(method, *params)
File "/opt/5.0.7-0_openerp/server/bin/netsvc.py", line 73, in __call__
return getattr(self, method)(*params)
File "/opt/5.0.7-0_openerp/server/bin/service/web_services.py", line 632, in execute
File "/opt/5.0.7-0_openerp/server/bin/service/web_services.py", line 612, in _execute
File "/opt/5.0.7-0_openerp/server/bin/wizard/__init__.py", line 178, in execute
File "/opt/5.0.7-0_openerp/server/bin/wizard/__init__.py", line 73, in execute_cr
File "/opt/openerp/server/bin/addons/base/module/wizard/wizard_module_upgrade.py", line 92, in _upgrade_module
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
File "/opt/5.0.7-0_openerp/server/bin/pooler.py", line 62, in restart_pool
return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
File "/opt/5.0.7-0_openerp/server/bin/pooler.py", line 40, in get_db_and_pool
addons.load_modules(db, force_demo, status, update_module)
File "/opt/5.0.7-0_openerp/server/bin/addons/__init__.py", line 740, in load_modules
File "/opt/5.0.7-0_openerp/server/bin/addons/__init__.py", line 584, in load_module_graph
File "/opt/5.0.7-0_openerp/server/bin/addons/__init__.py", line 373, in init_module_objects
File "/opt/openerp/server/bin/addons/c2c_partner_address/partner.py", line 138, in init
netsvc.LOG_INFO, msg,
NameError: global name 'msg' is not defined
So cause of it, I use a previous version of c2c_partner_address to run my test.
The second problem is linked to encoding of the data in partner.
I'm french, and so there is some é è à ê etc... that c2c_contact_to_ldap don't support. So, I just can't use the module in my society unfortunately.
Environment Information :
System : Linux-2.6.31-19-generic-i686-with-Ubuntu-9.10-karmic
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
Operating System Release : 2.6.31-19-generic
Operating System Version : #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : fr_FR.UTF8
Python Version : 2.6.4
OpenERP-Client Version : 5.0.7
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/opt/5.0.7-0_openerp/server/bin/netsvc.py", line 244, in dispatch
result = LocalService(service_name)(method, *params)
File "/opt/5.0.7-0_openerp/server/bin/netsvc.py", line 73, in __call__
return getattr(self, method)(*params)
File "/opt/5.0.7-0_openerp/server/bin/service/web_services.py", line 632, in execute
File "/opt/5.0.7-0_openerp/server/bin/service/web_services.py", line 612, in _execute
File "/opt/5.0.7-0_openerp/server/bin/wizard/__init__.py", line 178, in execute
File "/opt/5.0.7-0_openerp/server/bin/wizard/__init__.py", line 73, in execute_cr
File "/opt/openerp/server/bin/addons/c2c_contact_to_ldap/wizard/wiz_import_adresses.py", line 103, in _action_import_adresses
print error_report
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 23231: ordinal not in range(128)
For this problem, I propose either to implement support french encoding (even if it can be quite difficult cause of I suppose the problem come with python itself).
Or doing some rewrite of the data before export to LDAP. For example, change è and é in e. We do this in the past and it can be a good compromise.
I also have some remark concerning the global functioning of the export. So according to me :
-Empty field shouldn't generate a log error. For example if we don't have fax number for a partner, it's not necessary to mention it in the log.
-At the installation of c2c_partner_address, there is a lost of the name of the contact. At least, the value should be included in first name field. For the moment, we must use server migration to keep the data.
-Validate the international format at the input in the form of the phone number is a good idea. But it's a bad idea to block at the export every phone that are not in this format, cause it force to correct every number input before the install of the module (example (+32).81.81.37.00 is invalid)
-What use of address categories? Perhaps to export it as group and classify contact in group inside the LDAP, in that case I think it's a really good idea.
Thanks for reading.