Contributors mailing list archives

contributors@odoo-community.org

Re: Odoo 9 read from attachment

by
Georg Hasibether
- 24/04/2017 10:38:39

Hi Frederik,

thanks for your reply. You are right - too much hidden information.

I have a txt file with a json in it. I try to upload the file, read it, and fill out some fields with the read values.

certfile = fields.Binary("Certfile", attachment=True)

certfile.txt
{'issuer':'abcde' ....}


I tried this way https://www.odoo.com/forum/help-1/question/upload-files-to-openerp-through-custom-module-16828, and all (few) other possible solutions I ve found on stackoverflow.

I remember a XML-Template module from 7.0 or 8.0 which was able to import xsd with the ir.attachment and parsing values to the modelfields.

Kind regards

geohas


On 04/24/2017 11:37 AM, Frederik Kramer wrote:
<blockquote type="cite" cite="mid:1493026146.11279.4.camel@initos.com">
Hi Georg, 

i think your description has to much hidden information in order to
answer it precisely. Do you use the import feature in the backend ?
Do you want to read a binary data object (sequence of 0,1) or a binary
information (true / false) ? Where do you want to store it (object /
field in Odoo). If you explain it a bit more in detail i am sure you
will get more helpful answers

Kind regards

Frederik

Am Montag, den 24.04.2017, 09:23 +0000 schrieb Georg Hasibether:
> Hi all,
> 
> I try read values from a uploaded txt file in a binary field, without
> success.
> 
> Has anyone an idea how to solve it?
> 
> regards
> 
> 
> _______________________________________________
> Mailing-List: https://odoo-community.org/groups/contributors-15
> Post to: mailto:contributors@odoo-community.org
> Unsubscribe: https://odoo-community.org/groups?unsubscribe
-- 
Dr.-Ing. Frederik Kramer
Geschäftsführer
        
initOS GmbH
An der Eisenbahn 1
21224 Rosengarten
        
Phone:  +49 4105 56156-12
Fax:    +49 4105 56156-10
Mobil:  +49 179 3901819
        
Email: frederik.kramer@initos.com
Web:   www.initos.com
        
Geschäftsführung:
Dr.-Ing. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke

Sitz der Gesellschaft: Rosengarten – Klecken
Amtsgericht Tostedt, HRB 205226
Steuer-Nr: 15/200/53247
USt-IdNr.: DE815580155

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe