# Best practice for button and workflow decorators

**URL:** https://discuss.tryton.org/t/best-practice-for-button-and-workflow-decorators/3503
**Category:** Developer
**Created:** [November 29, 2020, 9:41pm UTC](https://discuss.tryton.org/t/best-practice-for-button-and-workflow-decorators/3503 "2020-11-29T21:41:40Z")
**Posts on this page:** 4
**Page:** 1

<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: [November 29, 2020, 9:41pm UTC](https://discuss.tryton.org/t/best-practice-for-button-and-workflow-decorators/3503/1 "2020-11-29T21:41:40Z")

</div>

Say I develop a module that inherits method that has the button and/or workflow.transition decorators.

Should the inheriting method also add those decorators?

I’ve always added them and I could find examples in core modules that add the decorators (I think they’re added in most cases):

> <https://github.com/tryton/commission/blob/develop/invoice.py#L31>

But also examples that don’t:

> <https://github.com/tryton/purchase/blob/develop/invoice.py#L99>

> <https://github.com/tryton/sale/blob/develop/invoice.py#L93>

---

<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: [November 29, 2020, 10:28pm UTC](https://discuss.tryton.org/t/best-practice-for-button-and-workflow-decorators/3503/2 "2020-11-29T22:28:11Z")

</div>

It just depend if you need or not the filtering of workflow or the access check of button.

---

<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: [November 29, 2020, 10:30pm UTC](https://discuss.tryton.org/t/best-practice-for-button-and-workflow-decorators/3503/3 "2020-11-29T22:30:34Z")

</div>

But that is always “needed” and both are going to be checked when calling super(), isn’t it?

---

<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: [November 29, 2020, 10:31pm UTC](https://discuss.tryton.org/t/best-practice-for-button-and-workflow-decorators/3503/4 "2020-11-29T22:31:55Z")

</div>

It is not always needed as for the two examples you give.  
The check on super may not be enough.
