### 模型继承 Odoo提供两 *继承* 机制,以模块化的方式扩展现有的模型。 第一继承机制允许模块来修改定义在另一个模块中定义的模型的行为: * 向模型添加字段, * 重写模型中的字段的定义, * 将约束添加到模型中, * 添加方法到模型, * 覆盖模型的现有方法. 二次继承机制(委托)允许将每一个模型的每一个记录与父模型中记录的记录连接起来,并提供对父记录字段的透明访问。 ![](https://www.odoo.com/documentation/9.0/_images/inheritance_methods.png) 再者见 * [`_inherit`](https://www.odoo.com/documentation/9.0/reference/orm.html#openerp.models.Model._inherit "openerp.models.Model._inherit") * [`_inherits`](https://www.odoo.com/documentation/9.0/reference/orm.html#openerp.models.Model._inherits "openerp.models.Model._inherits")