Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged

Is there any way to submit data from the website to a server action and return a url back to the client, without developing a custom module?

1. A website user types "1000" and clicks a button.

2. A server action computes a url "https://externalsite.com/1000".

3. The client will send the user to the url "https://externalsite.com/1000"

Q1: How to pass data from the website to the server action?

Q2: How to return the dynamic url to the client?

I made a server action for model "website.page" with this test code:

action = {
    "type": "ir.actions.act_url",
    "url": "https://odoo.com",
    "target": "self",
}

I clicked the button "Create Contextual Action". Navigating to the list of website pages, opening a page in form view and clicking the context menuitem will route me to odoo.com.

I clicked to make the server action available on the website, as http://localhost:8072/website/action/test. This link will NOT route me to odoo.com even though the code is executing. Why?

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
maj 25
9791
3
mar. 24
5441
0
jan. 21
5093
1
jan. 21
3463
1
apr. 17
7563