# How to open new URL window from Button

**URL:** https://discuss.tryton.org/t/how-to-open-new-url-window-from-button/1878
**Category:** Developer
**Created:** [October 26, 2019, 4:48am UTC](https://discuss.tryton.org/t/how-to-open-new-url-window-from-button/1878 "2019-10-26T04:48:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [October 26, 2019, 4:48am UTC](https://discuss.tryton.org/t/how-to-open-new-url-window-from-button/1878/1 "2019-10-26T04:48:55Z")

</div>

Hi,

Scenario:  
User input the values at form and click on the “Preview” button. We will use the value to generate the custom URL and calling third party website.

1. May I know how to open URL from Button?

I had tried to create the “ir.action.url” and using decorator “@ModelView.Button\_action(action)”. Tryton can open the URL from “ir.action.url” but it return fixed value of URL “ir.action.url”.

1. Beside question [1] or can dynamic value “URL” using button\_action?

Best regards

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 26, 2019, 10:39am UTC](https://discuss.tryton.org/t/how-to-open-new-url-window-from-button/1878/2 "2019-10-26T10:39:05Z")

</div>

You could use a char field filled with the URL and display using the `url` widget.

But I think be good to allow dynamic action: [Allow ModelView.button\_action returns action values (#8766) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue8766)

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [November 25, 2019, 10:46am UTC](https://discuss.tryton.org/t/how-to-open-new-url-window-from-button/1878/3 "2019-11-25T10:46:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
