# Action on selected rows in list view

**URL:** https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415
**Category:** Developer
**Created:** [August 5, 2023, 2:57pm UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415 "2023-08-05T14:57:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [August 5, 2023, 2:57pm UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415/1 "2023-08-05T14:57:47Z")

</div>

Hi,

Is it possible to have an action on a set of selected rows of a list view via the Wizard or a button in the header?  
Or do I need to implement a button in each row to change the state of the row wanted instead of selecting them?

Laurent.

---

<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: [August 5, 2023, 4:16pm UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415/2 "2023-08-05T16:16:39Z")

</div>

> [@lb1975](#):
>
> Is it possible to have an action on a set of selected rows of a list view via the Wizard or a button in the header?

You can add the keyword `form_action` to the `ir.action` and it will be available in the “Launch Action” menu.

> [@lb1975](#):
>
> Or do I need to implement a button in each row to change the state of the row wanted instead of selecting them?

Buttons on the list that are available for all the selected records are also in the “Launch Action” menu.

---

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [August 5, 2023, 4:42pm UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415/3 "2023-08-05T16:42:47Z")

</div>

Thanks Cédric, I’ve managed to create a Wizard that I see in the “Launch Action” menu, but I don’t know how to get only the rows marked with a tick by the user and not all the rows of the model ?

---

<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: [August 5, 2023, 4:52pm UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415/4 "2023-08-05T16:52:13Z")

</div>

> [@lb1975](#):
>
> I don’t know how to get only the rows marked with a tick by the user and not all the rows of the model ?

Actions are always run on the selected record. So in your wizard, the [records](https://docs.tryton.org/projects/server/en/latest/ref/wizard.html#trytond.wizard.records) attribute contains the selected records.

---

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [August 5, 2023, 5:50pm UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415/5 "2023-08-05T17:50:10Z")

</div>

Perfect thanks a lot !

---

<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: [August 6, 2023, 5:51am UTC](https://discuss.tryton.org/t/action-on-selected-rows-in-list-view/6415/6 "2023-08-06T05:51:11Z")

</div>

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