Hey Cyllo community, anyone have experience with delegation inheritance? I'm stuck and could use a hand!
Welcome!
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
This question has been flagged
Here's how you can achieve delegation inheritance in Odoo to add extra fields to an existing model without altering its structure. This setup uses a Many2one relationship to link the extension to the original model, inheriting the fields seamlessly. The child model gets all fields of the parent, but the database table structure remains separate. class EmployeeExtension(models.Model): _name = 'employee.extension' _inherits = {'hr.employee': 'employee_id'} # Delegates to hr.employee employee_id = fields.Many2one('hr.employee', required=True, ondelete='cascade') extra_field = fields.Char(string='Extra Info')