I'm trying to download a text file but when I click the button, it respondes with a 404 error, what am i doing wrong?
from odoo import models, fields
import base64
class HrEmployee(models.Model):
_inherit = "hr.employee"
your_file = fields.Binary("My_file.txt")
defaction_test_function(self):
data = "Your text goes here"
self.your_file = base64.b64encode(data.encode())
return {
'type': 'ir.actions.act_url',
'url': '/web/content/hr_employee/%s/custom_addon/models/%s?download=true' % (self.id, "My_File.txt"),
}
thanks in advice, every help is appreciated