Bug in codec of msg's error of import data in spanish language.

Bug #546591 reported by Moisés López - http://www.vauxoo.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Invalid
Undecided
Jay Vora (Serpent Consulting Services)

Bug Description

When the msg of error in the import is in spanish, for example:
  "El código del producto tiene que ser único"
Get a error of codec's

****MYPRINT1*****res[1] {'track_production': False, 'purchase_line_warn': 'no-message', 'track_incoming': False, 'track_outgoing': False, 'price_extra': 0.0, 'default_code': 'ZAL-001', 'active': True, 'price_margin': 1.0, 'sale_line_warn': 'no-message'}
****MYPRINT2*****d ['\ttrack_production: False\n\tpurchase_line_warn: no-message\n\ttrack_incoming: False\n\ttrack_outgoing: False\n\tprice_extra: 0.0\n\tdefault_code: ZAL-001\n\tactive: True\n\tprice_margin: 1.0\n\tsale_line_warn: no-message\n']
****MYPRINT3*****res[2] Line 1 : El código del producto tiene que ser único !
****MYPRINT4*****res[3]

Environment Information :
System : Windows-32bit
OS Name : nt
Operating System Release :
Operating System Version : 32bit
Operating System Architecture : 32bit
Operating System Locale : es_MX.cp1252
Python Version : 2.5.1
OpenERP-Client Version : 5.0.7
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
 File "C:\openerp-client-gtk\bin\modules\gui\main.py", line 1334, in _sig_child_call
res = wid.handlers[button_name]()
 File "C:\openerp-client-gtk\bin\modules\gui\window\form.py", line 275, in sig_import
res = win.go()
 File "C:\openerp-client-gtk\bin\modules\gui\window\win_import.py", line 251, in go
return import_csv(csv, inverted, self.model, self.fields_invert, context=self.context)
 File "C:\openerp-client-gtk\bin\modules\gui\window\win_import.py", line 73, in import_csv
error = u'Error trying to import this record:\n%s\nError Message:\n%s\n\n%s' % (d,res[2],res[3])
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 13-16: invalid data

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

 "El código del producto tiene que ser único"
The default code of product have to unique.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Hello
I changed my source code editor, which is configured with utf-8, save changes on my module with the message in Spanish and it was repaired the problem, however, not before it caused me problems.

Changed in openobject-client:
assignee: nobody → Jay (Open ERP) (jvo-openerp)
milestone: none → 5.0.9
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi moylop260,

I have checked this issues 3 times with different locale and I could not face any problem.

Kindly reopen the bug if it happens again. We would love to fix that out.

Thanks.

Changed in openobject-client:
status: New → Invalid
Changed in openobject-client:
milestone: 5.0.9 → 5.0.10
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Hola Jay

I have already been checking more detail the error
And I discovered that my module was added because of a unique constraint (default_code), with the message in Spanish, but the file was not UTF-8
Therefore, it generates the error.
But it would be good to have a TRY-EXCEPT to catch this error and does not happen the same thing to me was they did not know why, and do not send BUG's

Thanks for your attention

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.