When using the _inherit and _name attributes together, Odoo creates a new model using the existing one as a base. The new model gets all the fields, methods and meta-information from its base.
For example you can take idea from below code-
class Inheritance0(models.Model):
_name = 'inheritance.0'
name = fields.Char()
def call(self):
return self.check("model 0")
def check(self, s):
return "This is {} record {}".format(s, self.name)
class Inheritance1(models.Model):
_name = 'inheritance.1'
_inherit = 'inheritance.0'
def call(self):
return self.check("model 1")
0 Comment(s)