Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
8 Views

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.

Avatar
Discard

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" ```

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!