Odoo / Model / model inheritance
Model Inheritance
-
Step 1:
Example 1
from odoo import fields, models class InheritedModel(models.Model): _inherit = "inherited.model" new_field = fields.Char(string="New Field") inherited.model.form.inherit.test inherited.model to get inherited.inherited_model_view_form
1. enable developer mode 2. go to view form of parent module
3. go to edit form option
4. inspect external ID optionExample 2
from odoo import models, fields class SaleOrderInherited(models.Model): _inherit = 'sale.order' custom_field = fields.Char(string='Custom Field') sale.order.custom.form.inherited sale.order