Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehrishnaz/75c27c67604888ca1c3b7630ea499ce1 to your computer and use it in GitHub Desktop.
Save sehrishnaz/75c27c67604888ca1c3b7630ea499ce1 to your computer and use it in GitHub Desktop.
Override Built-in Modules Button Method in Odoo
class account_voucher(models.Model):
_inherit = 'account.voucher'
# By using old api
def button_proforma_voucher(self,cr, uid, ids, context=None):
obj = super(account_voucher, self).button_proforma_voucher(cr, uid, ids, context=None)
# add your custom functionality here
return obj
# By using new api
@api.multi
def button_proforma_voucher(self):
obj = super(account_voucher, self).button_proforma_voucher()
# add your custom functionality here
return obj
@sehrishnaz
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment