Thursday, August 31, 2023

specific view for many2one field in odoo

 


In this blog we will explain how to add specific view for many2one field in odoo 

so to explain that let us say we created custom form view for the product unit of measure and we want to open it from uom_id field in product view just like at the image , so we must inherit the product from view , then add context attribute to uom_id field , just like bellow 

<xpath expr="//field[@name='uom_id']" position="attributes">
     <attribute name="context">
          {'form_view_ref':'custom_module_name.custom_form_view_id'}
     </attribute>
</xpath>


No comments:

Post a Comment

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...