Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2155 Widoki

hello everyone

I have created a form on a website page so that users can enter their product information, after submitting the form I want to save all the information as a new product. How do I do that?


Awatar
Odrzuć
Najlepsza odpowiedź

 Hi
You can add a controller to do that

1.In website form add the action and method as post-

action="/create/product" method="POST" 


2.Add a controller
@http.route('/create/product', type="http", auth="public", website=True) 
 def create_product(self, **kw): 
request.env['product.patient'].sudo().create(kw)


Make sure that the fields in the website form is same as product,otherwise add them as a dict instead of kw

Awatar
Odrzuć
Najlepsza odpowiedź

Hello, 

it is very simple with the help of Studio. You can go to the inventory => Products. Then click on the studio icon and go the website tab. Then click on the form and prepare the form in the website. 



Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 25
267
2
cze 25
1727
0
mar 25
1603
0
lut 25
1247
3
sie 24
5937