# Override workflow button

**URL:** https://discuss.tryton.org/t/override-workflow-button/6540
**Category:** Developer
**Created:** [September 27, 2023, 12:04pm UTC](https://discuss.tryton.org/t/override-workflow-button/6540 "2023-09-27T12:04:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [September 27, 2023, 12:04pm UTC](https://discuss.tryton.org/t/override-workflow-button/6540/1 "2023-09-27T12:04:51Z")

</div>

When I want to override in a custom module some workflow I usually do this:

```auto
    @classmethod
    @ModelView.button
    @Workflow.transition('validated')
    def validate_invoice(cls, invoices):
        super().validate_invoice(invoices)
        # My stuff

```

But I notice that doing this it also works:

```auto
    @classmethod
    def validate_invoice(cls, invoices):
        super().validate_invoice(invoices)
        # My stuff

```

So I’m wondering if it’s needed for something the ModelView and Workflow. Also I want to question about other decorators like `@set_employee('quoted_by')`.

Thanks.

---

<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: [September 28, 2023, 6:31am UTC](https://discuss.tryton.org/t/override-workflow-button/6540/2 "2023-09-28T06:31:32Z")

</div>

`ModelView.button` is a requirement to get security enforcement on your custom code.

For this other, it is better because it ensure the same behavior no matter if the method is extended or not.  
And usually we can ignore the `set_employee` because it has no impact on the actual code of the method.

---

<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: [September 28, 2023, 6:31pm UTC](https://discuss.tryton.org/t/override-workflow-button/6540/3 "2023-09-28T18:31:48Z")

</div>

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