Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use extension method in openERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 126
    Comment on it

    When using _inherit but leaving out _name, the new model replaces the existing one, essentially extending it in-place. This is useful to add new fields or methods to existing models (created in other modules), or to customize or reconfigure them.
    For example you can take idea from below code-

    class Extension0(models.Model):
        _name = 'extension.0'
    
        name = fields.Char(default="A")
    
    class Extension1(models.Model):
        _inherit = 'extension.0'
    
        description = fields.Char(default="Extended")
            record = env['extension.0'].create({})
            record.read()[0]
    

 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: