How to edit the PRO -FORMA button in the account.invoice model? <p>I 'm doing a function that executes when the PRO -FORMA press the button account.invoice model.</p> <p>I tried but I have not found a default function of this button to edit it. So I created a function does not work.</p> <p><a href="https://i.stack.imgur.com/5axKK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5axKK.png" alt="enter image description here"></a></p> <p>Does anyone know where I could edit the function of this button or create a function ?</p> <p>At the view, the button is as follows:</p> <pre><code>`&lt;button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/`&gt; </code></pre> <p>And this is the function of the button , but does not work . This in account.invoice.py file :</p> <pre><code>@api.multi def invoice_proforma2(self): for invoice in self: invoice.x_id_proforma = self.env['ir.sequence'].next_by_code('account.invoice.x_id_proforma') </code></pre> <p>I would appreciate some help to understand why this does not work . Thank you.</p>