Skip to Content
Menu
This question has been flagged
2 Replies
1072 Views

I have created a module that inherits the "sale" module. I would now like to create a view in my new module that will inherit the "view_order_form" view from the "sale" module. In fact I want to be able to use this view when I access my module. 
A bit like when you want to create a view with the CRM module and you are redirected to the "dirty" module. Thank you for your help.

Avatar
Discard
Author Best Answer

Oh I see, thanks a lot!

Avatar
Discard
Best Answer

Hi,

Are you looking to inherit and create new view or modify existing view only ? If you modify existing view, it will be reflected in its original place as well in the other place where it has been used.


Suppose if you need to inherit and create a new view without affecting in its original view, you can set the mode as primary for the inherited view.


Sample:


<record id="mrp_product_template_search_view" model="ir.ui.view">
<field name="name">mrp.product.template.searchfield>
<field name="model">product.templatefield>
<field name="mode">primaryfield>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
<filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
xpath>
field>
record>




Then the created view, can be specified in the action in view_ids.


To inherit and modify any existing view, see: https://www.youtube.com/watch?v=46yecsKX2tw


Thanks

Avatar
Discard