Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I created a model with field named 'data_xml' which is a Many2many field to ir.attachment model and I have been able to insert an encoded XML file in ir.attachment by using the code shown below and everything works perfect (i.e the file can be opened in the user interface by clicking on the corresponding file inside the 'data_xml' field). Now, I need to open files uploaded that way in order to process them with python code, however I am experiencing trouble when trying to restore contents of db_datas field (I undestand it is difficult to get the contents since it is a Bytea field).
I tried suggestions in
https://www.odoo.com/es_ES/forum/help-1/question/solved-convert-picture-bytea-to-binary-in-a-python-file-30561, however I haven't been able get the XML content inside the field. Can any body provide suggestions on how I should proceed to be able to restore the XML content?
Thanks in advance for your help.
xml_binary = base64.b64encode(xml_FILE)
recordnumber = self.number
ir_att_name_file='FILE-XML ' + ir_att_name_file + '.xml'
ir_att_datas_fname = ir_att_name_file
ir_att_res_model = 'office.model'
ir_att_res_name=record.number + ' ...'
ir_att_Index_content = '(u\'application\',)'
ir_att_file_size = 1000
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/17/16, 12:19 AM|
|Seen: 586 times|
|Last updated: 2/17/16, 12:31 AM|