Community mailing list archives

community@mail.odoo.com

Re: how to read XLS file in Odoo

by
Cristian Salamea
- 09/12/2014 12:14:54


On Fri, Sep 12, 2014 at 9:55 AM, Markus Schneider <markus.schneider@initos.com> wrote:
OCA modul https://github.com/OCA/web/blob/7.0/web_export_view/ does the same

web_printscreen_zb its realy better :-)

 
On 12.09.2014 15:02, Amol Anant wrote:
> Hi Team,
> 
> This Module to export current active tree view  exactly same in to excel
> report
> 
> PFA
> 
> Thanks
> 
> 
> 
> Amol Gangajaliwale
> 
> +918826673959
> 
> 
> On Fri, Sep 12, 2014 at 5:30 PM, Markus Schneider
>  wrote:
> 
>     Hi,
> 
>     We read xls files with xlrd python lib [1] and this works really great.
>     We combine this with our connector_flow [2] module. But no need for
>     this. So first Task reads xls and make chunks of rows. The second task
>     import the chanks in what ever you need.
> 
>     In our use case we implemented this to import a excel list with
>     inventory correction.
> 
>     So the mayn code looks like:
> 
>     from xlrd import open_workbook
> 
>     #it is meta object of ir.attachment
>     file_obj = self.session.pool.get('impexp.file')
>     f = file_obj.browse(self.session.cr , self.session.uid, file_id)
>     data_file = b64decode(f.attachment_id.datas)
> 
>     wb = open_workbook(file_contents=data_file)
>     for s in wb.sheets():
>         for row in range(s.nrows):
>             data_row = []
>             for col in range(s.ncols):
>                 value = (s.cell(row, col).value)
>                 data_row.append(value)
> 
>     The Code is part of a bigger module where all the mapping stuff is hard
>     codet so we need to make a complete example but at the moment not time
>     for this.
> 
>     Kind Regards
> 
>     Markus
> 
> 
>     [1] https://pypi.python.org/pypi/xlrd
>     [2] http://bazaar.launchpad.net/~initos.com/+junk/connector_flow/files
>     On 11.09.2014 16:15, abhishek jaiswal wrote: > Hi all, > > Can any
>     body please tell how to read and process excel file in Odoo or > any
>     example > > it will be very help full thanks > > -- > With Warm
>     Regards > Abhishek Jaiswal, > >
>     _______________________________________________ > Mailing-List:
>     https://www.odoo.com/groups/community-59 > Post to:
>     mailto:community@mail.odoo.com <mailto:community@mail.odoo.com> >
>     Unsubscribe: https://www.odoo.com/groups?unsubscribe
> 
>     > 
> 
>     -- 
>     Dipl.-Comp.-Math. Markus Schneider
>     Softwareentwickler
> 
>     initOS GmbH & Co. KG
>     An der Eisenbahn 1
>     21224 Rosengarten
> 
>     Mobil:   +49 (0)172 2303699
>     Phone:   +49 (0)4105 5615613
>     Fax:     +49 (0)4105 5615610
> 
>     Email:   markus.schneider@initos.com <mailto:markus.schneider@initos.com>
>     Web:     http://www.initos.com
> 
>     Geschäftsführung:
>     Dipl. Wirt.-Inf. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke
>     Haftende Gesellschafterin: initOS Verwaltungs GmbH
> 
>     Sitz der Gesellschaft: Rosengarten – Klecken
>     Amtsgericht Tostedt, HRA 201840
>     USt-IdNr: DE 275698169
>     Steuer-Nr: 15/205/21402
> 
>     _______________________________________________
>     Mailing-List: https://www.odoo.com/groups/community-59
>     Post to: mailto:community@mail.odoo.com <mailto:community@mail.odoo.com>
>     Unsubscribe: https://www.odoo.com/groups?unsubscribe
> 
> 
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
> 

-- 
Dipl.-Comp.-Math. Markus Schneider
Softwareentwickler

initOS GmbH & Co. KG
An der Eisenbahn 1
21224 Rosengarten

Mobil:   +49 (0)172 2303699
Phone:   +49 (0)4105 5615613
Fax:     +49 (0)4105 5615610

Email:   markus.schneider@initos.com
Web:     http://www.initos.com

Geschäftsführung:
Dipl. Wirt.-Inf. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke
Haftende Gesellschafterin: initOS Verwaltungs GmbH

Sitz der Gesellschaft: Rosengarten – Klecken
Amtsgericht Tostedt, HRA 201840
USt-IdNr: DE 275698169
Steuer-Nr: 15/205/21402

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
 
Cristian Salamea on about.me
 
Cristian Salamea
about.me/ovnicraft