This question has been flagged
1 Reply
4844 Views

Hi !

I am making an extension of the module website_sale, in order to use the cart and payment stuff.

I want to create a form where the user can select things in selection widgets. Then, I want to trigger changes in the price when the value of these selection wigdet change. Finally, I want to create a product from there and add it to the cart.

But the thing is, it's the first time I work with odoo website functionnalities. I don't know if I have to use javascript, and how. I have checked the doc, but eh, no much help there. Or perhaps I can make a python function and use it in the qweb template ? I don't know. Some help, clues, examples will be greatly appreciated.

Edit:

After some reading, I know how to build widgets using qweb templates and js. I know how to call a widget from a menu in the backend.

Now, how to include my custom widget in a template in the frontend ?

Avatar
Discard
Best Answer

Okay, if you want to know how a basic form works, take a look at the contact us page and open the html editor on the front end. You will see how odoo will build the form and how it positions the form on the page. The actual data of the form will be in a separate file, which you can access also through the html editor on the front-end, this one is called "contact form" 


take a good look at them, and maybe you know enough how to build your own.

if you think this answer has helped you, then please vote with a thumbs up.

 

 

Avatar
Discard
Author

Okay, but how do I process the data after that ? How do I build a selection box ?

If you take a closer look in the contact form as I mentioned here above. you will see that the data the user has typed in the contact form is placed in the lead section of your sales module. So you just can filter, expert or whatever you want to do with it. Maybe you want to create a news brief for those new contacts. It's all possible.

If you take a closer look in the contact form as I mentioned here above. you will see that the data the user has typed in the contact form is placed in the lead section of your sales module. So you just can filter, expert or whatever you want to do with it. Maybe you want to create a news brief for those new contacts. It's all possible.