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
44 Views

Hey Cyllo community! Anyone got any good tips for inheriting form views? I'm struggling a bit and could use some pointers.

Avatar
Discard

Here's how you can use view inheritance in Odoo to extend or modify existing views. I'll cover both the 'extension' and 'primary' modes. View Inheritance: mode="extension" This is the default mode and allows you to extend an existing view without overriding it. You can have multiple extension views for a single primary view.

 

    product.category.view.form.inherit.your.module2

    product.category

   

    extension

   

       

           

       

   

inherit_id references the view being extended. xpath locates where to inject or modify content.

You can use position="after", before, replace, attributes,etc.

mode="primary" 

Declares this view as the main view for the model. Only one view per type (e.g., form) can be primary. Used instead of overriding existing view IDs.


    product.category.view.form.your.module2

    product.category

   

    primary

   

       

           

       

   


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!