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.
Hello. I need to know how to make a file upload to the server OpenERP. I'm creating a module which has to allow me to do an upload of a file to the server, then do a treatment for their content. I have done the treatment but n ose content as I can make a system call OpenERP to Upload File.
you can use
fields.binary. you can save your file in database.
in your file.py
in your file.xml:
<field name="data" /> and <button name="import_file" string="Import" type="object" class="oe_highlight" />
if you clik in button Import it call function import_file
in your function :
create a temp file for treatment content data.
def import_file(self, cr, uid, ids, context=None): fileobj = TemporaryFile('w+') fileobj.write(base64.decodestring(data)) # your treatment return
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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: 5/15/13, 1:41 PM|
|Seen: 11397 times|
|Last updated: 1/10/16, 9:16 PM|