Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sehrishnaz/8defd5c315c3ac25a9eb5d3e3c8ecc2d to your computer and use it in GitHub Desktop.
Save sehrishnaz/8defd5c315c3ac25a9eb5d3e3c8ecc2d to your computer and use it in GitHub Desktop.
Upload Images and File in Odoo Website Using Web Form
<template id="detail" name="Project Detail">
<t t-call="website.layout">
<div class="col-md-offset-5 col-sm-offset-4 col-sm-8 col-md-7" style="margin-top:30px;">
<form action="/project/uploaded" method="post" class="s_website_form form-horizontal container-fluid mt32" enctype="multipart/form-data" id="file_upload_form">
<div t-attf-class="form-group">
<div class="col-md-7 col-sm-8">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<input type="hidden" name="project_id" t-att-value="project.id"/>
<input type="file" name="attachment" class="file" multiple="true" data-show-upload="true" data-show-caption="true" lass="file" data-show-preview="true" id="project.id"/>
<button type="submit" name="Upload" style="margin-top:20px;" class="fa fa-upload">Upload</button>
</div>
</div>
</form>
</div>
</t>
</template>
@sehrishnaz
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment