My friend,
I want to know how to create execl file in odoo 10 and let the user save it in local client machine.
Thank you.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
My friend,
I want to know how to create execl file in odoo 10 and let the user save it in local client machine.
Thank you.
Hello Haolingoa,
To create an Excel file, you should used the library "xlwt".
In the first time you must created a "TransiantModel", in this model you create a "fields.Binary". This binary field will be your "Download link".
class YourWizard(models.TransiantModel):
_name = "your.wizard"
your_excel = fields.Binary(string="Your excel")
In the last step you need to write the new excel file created in the field Binary, for this you should used "StringIO" and "Base64".
After you have create you excel file. You can save and link to field binary like this:
def save_excel(self, excel):
stream = StringIO()
excel.save(stream)
encoding_stream = base64.encodestring(stream.getvalue()
self.write('your_excel':encoding_stream)
And with this you can showing your wizard.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Hello haolingca,
Did you mean Excel report in Odoo?
Please update your question with which view, model and whether report or custom one