Skip to content
Advertisement

how to save a data to backend thrhough controller from selecting a dropdown list in the website odoo 12?

Ive been trying to take a user input from the dropdown list and update it to the backend through controller.i will explain my code below,

JS

JavaScript

XML

JavaScript

controller.py

JavaScript

What my concern is i dont know how to give the input class to <select> <option> dropdown list and make it to save to the backend through controller when the user click the button named save

Advertisement

Answer

It’s based on how you are render the view through- JS or controller.

Any way you should get hr.blood_group as a dictionary like – {‘o+’:”O+”,..}

then you can replace the option as below code.

JavaScript

This is the base reference I can give, if you have any queries comment below.

Also, I’m adding a reference link from the website, take a look at it.

https://github.com/odoo/odoo/blob/7ddf36474596ec5213aba7b892c1a62998c99da9/addons/website/static/src/xml/website.contentMenu.xml#L28

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement