Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3752 Переглядів

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?

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
трав. 25
9787
3
бер. 24
5432
0
січ. 21
5075
1
січ. 21
3456
1
квіт. 17
7556