|
@ -32,6 +32,7 @@ class AttachmentController(http.Controller): |
|
|
@http.route('/utils/attachment/add', type='http', auth="user", methods=['POST']) |
|
|
@http.route('/utils/attachment/add', type='http', auth="user", methods=['POST']) |
|
|
def add_attachment(self, ufile, temporary=False, **kw): |
|
|
def add_attachment(self, ufile, temporary=False, **kw): |
|
|
tmp = temporary and str2bool(temporary) or False |
|
|
tmp = temporary and str2bool(temporary) or False |
|
|
|
|
|
name = "Access Attachment: %s" % ufile.filename |
|
|
attachment = request.env['ir.attachment'].create({ |
|
|
attachment = request.env['ir.attachment'].create({ |
|
|
'name': tmp and "%s (Temporary)" % name or name, |
|
|
'name': tmp and "%s (Temporary)" % name or name, |
|
|
'datas': base64.b64encode(ufile.read()), |
|
|
'datas': base64.b64encode(ufile.read()), |
|
|