I want to the user to upload an excel file using an HTML form (input type="file") and then process it in a controller and make records based on its rows. how can I achieve it? Thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
I've figured it out myself.
xml:
<form class="o_form_binary_form" method="POST" enctype="multipart/form-data" action="/my/order/excel/uploaded">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<label class="control-label" for="file">File:</label>
<input accept="xls, .xlsx" class="o_input_file" type="file" name="file"/>
<button type="submit" class="btn btn-primary pull-left">Submit</button>
</form>
// do what you do
Hi you can check this:
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
Feb 21
|
2457 | ||
|
3
Nov 20
|
4836 | ||
|
1
Jul 20
|
15751 | ||
|
1
Jan 21
|
3187 | ||
|
2
Oct 24
|
3562 |