Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Odoo Model inheritance

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 234
    Comment on it

    Odoo provides two inheritance mechanisms to extend an existing model in a modular way.
    The first inheritance mechanism allows a module to modify the behavior of a model defined in another module:
    1. add fields to a model,
    2. override the definition of fields on a model,
    3. add constraints to a model,
    4. add methods to a model,
    5. override existing methods on a model.
    With the help of the second inheritance mechanism (delegation), you can easily perform the task of linking every record of a model to a record in a parent model. Moreover, it paves the way to provide transparent access to the fields of the parent record.

    View inheritance
    Odoo does not modify existing views in place by overwriting them. It in fact provides view inheritance, which is evident in children "extension" views that are applied on top of root views. Odoo also makes it possible to add or remove content from their parent.
    Using the inherit_id field, an extension view references its parent. Please take a note that instead of a single view, its arch field is composed of any number of xpath elements selecting and altering the content of their parent view:

     <pre>   ondelete='cascade', string="Course", required=True)</pre>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: