# Create a button that redirect to flask application

**URL:** https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867
**Category:** Developer
**Tags:** flask
**Created:** [December 16, 2021, 10:27pm UTC](https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867 "2021-12-16T22:27:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![andres53016](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/andres53016/32/406_2.png) [@andres53016](https://discuss.tryton.org/u/andres53016)
#### Post date: [December 16, 2021, 10:27pm UTC](https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867/1 "2021-12-16T22:27:18Z")

</div>

I wanted to know if it was possible to create a button that redirects me to the flask application with arguments that depend on the current record.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [December 17, 2021, 8:08am UTC](https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867/2 "2021-12-17T08:08:39Z")

</div>

You can create a [URL action](https://demo6.2.tryton.org/#demo6.2/model/ir.action.url;name=%22Administration%20%2F%20User%20Interface%20%2F%20Actions%20%2F%20URLs%22&views=%5B33%2C32%5D).

If you want a button in the form or tree view you can use a [button\_action](https://docs.tryton.org/projects/server/en/latest/ref/models/models.html?highlight=button_action#trytond.model.ModelView.button_action). Either using this button\_action or by creating a wizard that returns a URL Action you can probably make it dynamic.

Another, simpler, option is to use the URL widget and a Function field. Just like the [google\_maps module](https://hg.tryton.org/modules/google_maps/file/tip/address.py) does.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [December 17, 2021, 8:32am UTC](https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867/3 "2021-12-17T08:32:41Z")

</div>

> [@albert](#):
>
> option is to use the URL widget and a Function field. Just like the [google\_maps module](https://hg.tryton.org/modules/google_maps/file/tip/address.py) does.

I will recomend using the URL widget with a function field. It will be easier and the arguments can be included depending on the record.

---

<div class="post-metadata">

### Author: ![andres53016](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/andres53016/32/406_2.png) [@andres53016](https://discuss.tryton.org/u/andres53016)
#### Post date: [December 17, 2021, 12:09pm UTC](https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867/4 "2021-12-17T12:09:41Z")

</div>

Thanks @albert and @pokoli. I will try the URL widget. And I didn’t know the URL Action, it’s good to know it exists.

---

<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: [January 16, 2022, 12:10pm UTC](https://discuss.tryton.org/t/create-a-button-that-redirect-to-flask-application/4867/5 "2022-01-16T12:10:20Z")

</div>

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