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?