In this article you will learn how to override Odoo methods. I will show you how to override Odoo Create, Write and Unlink method. Here the question is why we need to override these (create, write and unlink) methods.
The answer is to add or remove additional functionality we use overriding. For example if I want to check some constraints before creating, editing or deleting our record than we may use Odoo override methods.
There are basically three methods which we can override.
Create MethodThe create method invoke every time when we click on "Create" or "New" button on Odoo form view and when we save the from using Save button.
campus_create = super(Campus,self).create(values)
Below is the code snippet to override write method.
campus_write = super(Campus,self).write(values)
Below is the code snippet to override unlink method.
campus_unlink = super(Campus,self).unlink()