Skip to Content
Menu
This question has been flagged
1 Reply
1384 Views

i made some boolean field in some model and i made many2one field depends on the boolean model i need to invisible full line if the boolean was true is that possible? 

Avatar
Discard
Best Answer

Hi,

yes it is possible, check out this links:

 1. Forum Link: https://www.odoo.com/forum/help-1/attrs-multiple-condition-boolean-and-17889

2. Explaining Video : https://youtu.be/a7By61G3cds

the main idea is to use attrs with condition/conditions on fields which located in the model ,

for example:


Note: you can add this code into inherited view 

Hope this will help.

Avatar
Discard
Author

but mine its not inherit it is ,many2one only will it work?

Author

This my code
<record id="preventive_entry_tree" model="ir.ui.view">
<field name="name">pmentry.tree</field>
<field name="model">pmentry</field>
<field name="arch" type="xml">
<tree string="Product" default_order='pme_pmj_sortorder'>
<field name="pme_pmj_sortorder" optional="show"/>
<field name="pme_date" readonly="True" optional="show" />
<field name="pme_users" readonly="True" optional="show" />
<field name="pme_shift" optional="show" />
<field name="pme_pmcrecid" context="{'show_code':True}" optional="show" />
<field name="pme_pmj_description" optional="show" />
<field name="pme_query" optional="hide" />
<field name="pme_pmj_threshold" optional="hide" />
<field name="pme_value" optional="hide" />
<field name="pme_act_take" optional="hide" />
<field name="pme_pmj_testcycle" optional="hide" />
<field name="pme_status" optional="show" />
<field name="pme_rea_typ" optional="hide" />
<field name="pme_rea_des" optional="hide" />
</tree>
</field>
</record>
in ""pme_pmj_sortorder"" i have disable button in the same model i want when it is disable the full row including other fields to be invsible

Author

This is the form also in case you need it
record id="preventive_entry_form" model="ir.ui.view">
<field name="name">pmentry.form</field>
<field name="model">pmentry</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="pme_pmj_sortorder" editable="bottom" />
<field name="pme_date" readonly="True" />
<field name="pme_users" readonly="True" />
<field name="pme_shift" />
<field name="pme_pmcrecid" context="{'show_code':True}" />
<field name="pme_pmj_description" />
<field name="pme_query" />
<field name="pme_pmj_threshold" />
<field name="pme_value" />
<field name="pme_act_take" />
<field name="pme_pmj_testcycle" />
<field name="pme_status" />
<field name="pme_rea_typ" />
<field name="pme_rea_des" />
</group>
</sheet>
</form>
</field>
</record>

Related Posts Replies Views Activity
1
Nov 24
1487
1
Nov 24
1196
2
Sep 24
1047
1
Aug 24
2456
3
Aug 24
2687