Import CSV file fails

Bug #828959 reported by Mario Arias
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Incomplete
Low
OpenERP sa GTK client R&D

Bug Description

Hi, when you try to import a CSV file and it has any non UTF-8 character, the load fails with no warning...

on win_import.py, if a try.... except is added this can be avoided, like...

        try:
            datas.append(map(lambda x:x.decode(csv_data['combo']).encode('utf-8'), line))
        except:
            common.warning(_('Error on text file.\nCorrect %s and try again !') % (line,), _('Import Error.'), parent=parent)
            return False

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Mario Arias,

I have checked your scenario as per your specification.

I have import .csv file on "product.product" object and it is working fine at my end. I have attached a video for your

reference would you please check it and informed us where you faced the problem and provide your end configuration

with video or screenshot so we can reproduce same at our end.

Thanks and waiting for your reply.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :
Changed in openobject-client:
status: New → Incomplete
Revision history for this message
Mario Arias (the-clone-master) wrote : Re: [Bug 828959] Re: Import CSV file fails

Hi my friend,

The problem with your test is that you created the .csv file on linux, so
the file is still in UTF8 format...

Try creating the file on Windows, and then import it... You can confirm the
file has non UTF8 characters if you open it on linux and it shows squares or
weird symbols instead of the intended characters you included on the Windows
machine...

The problem goes away with just adding a try...except to the data.append
instruction on win_import.py file...

Regards,
-Mario

On Fri, Aug 19, 2011 at 4:23 AM, Vishal Parmar(Open ERP) <
<email address hidden>> wrote:

> ** Attachment added: "Importcsv.ogv"
>
> https://bugs.launchpad.net/openobject-client/+bug/828959/+attachment/2291339/+files/Importcsv.ogv
>
> ** Changed in: openobject-client
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/828959
>
> Title:
> Import CSV file fails
>
> Status in OpenERP GTK Client:
> Incomplete
>
> Bug description:
> Hi, when you try to import a CSV file and it has any non UTF-8
> character, the load fails with no warning...
>
> on win_import.py, if a try.... except is added this can be avoided,
> like...
>
> try:
> datas.append(map(lambda
> x:x.decode(csv_data['combo']).encode('utf-8'), line))
> except:
> common.warning(_('Error on text file.\nCorrect %s and try
> again !') % (line,), _('Import Error.'), parent=parent)
> return False
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-client/+bug/828959/+subscriptions
>

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

I can reproduce the bug from exported sheet from windows and import this into Linux.

Thanks.

Changed in openobject-client:
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Mario Arias (the-clone-master) wrote :

This can be easily fixed by just surrounding the "datas.append" line on win_import.py...

        try:
            datas.append(map(lambda x:x.decode(csv_data['combo']).encode('utf-8'), line))
        except:
            common.warning(_('Error on text file.\nCorrect %s and try again !') % (line,), _('Import Error.'), parent=parent)
            return False

Revision history for this message
Ravi Gadhia (OpenERP) (rga-openerp) wrote :

Hello Mario Arias,
                   I have checked the bug but can't reproduce it with latest revision, create csv file in windows and import it in ubuntu it's work fine. would you please provide us more detail to reproduce.

Changed in openobject-client:
status: Confirmed → Incomplete
Revision history for this message
Mario Arias (the-clone-master) wrote :

Hello my friend,

Not sure if you checked this... the csv file content in windows should
include "foreign" letters... like á or ñ...

Regards,
-Mario

On Fri, Nov 11, 2011 at 1:00 AM, Ravi Gadhia (OpenERP) <email address hidden>wrote:

> Hello Mario Arias,
> I have checked the bug but can't reproduce it with
> latest revision, create csv file in windows and import it in ubuntu it's
> work fine. would you please provide us more detail to reproduce.
>
>
> ** Changed in: openobject-client
> Status: Confirmed => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/828959
>
> Title:
> Import CSV file fails
>
> Status in OpenERP GTK Client:
> Incomplete
>
> Bug description:
> Hi, when you try to import a CSV file and it has any non UTF-8
> character, the load fails with no warning...
>
> on win_import.py, if a try.... except is added this can be avoided,
> like...
>
> try:
> datas.append(map(lambda
> x:x.decode(csv_data['combo']).encode('utf-8'), line))
> except:
> common.warning(_('Error on text file.\nCorrect %s and try
> again !') % (line,), _('Import Error.'), parent=parent)
> return False
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-client/+bug/828959/+subscriptions
>

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.