Hey Cyllo folks, how do I add a new field to a model and then update the function that uses that model? I'm a bit stuck on the best way to do this.
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
1
Reply
8
Views
That's a great question about extending Odoo models! Here's how you can achieve that using inheritance. You can inherit an existing model to add new fields or methods. You don’t change the model name but enhance its behavior. class ResPartner(models.Model): _inherit = 'res.partner' custom_field = fields.Char(string='Custom Field') def custom_method(self): return "Custom functionality" ```