Good afternoon,
I'm trying to make a column not visible according to a condition, but I don't know why the change does not take effect.
odoo11
* I have no error of any kind. is updated correctly.
Steps:
1-create in the model res_company a new field called:
tipo_envio = fields.Selection(selection=[("0","0 - P"),("3","3 - E")])
2-from the invoice view (account_invoice), filter the value according to the new field created in res_company.
current value in res_company.shipment_type = 0
<record model="ir.ui.view" id="des.view_account_invoice_mobile">
<field name="name">Cambios</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="invoice_line_ids" position="inside">
<form>
<group>
<field name="company_id" invisible="1"/>
<field name="otros" attrs="{'invisible':[('company_id.tipo_envio','not in',['3'])]}"/>
</group>
</form>
</field>
</field>
</record>
Also try creating a new field in the account_invoice_line model
related_tipo_envio = fields.Selection(related="company_id.tipo_envio",store=True)
but it doesn't work either.
<field name="otros_cargos_items" attrs="{'invisible':[('related_tipo_envio','!=','3')]}"/>
<field name="factor_isc" attrs="{'invisible': [('related_tipo_envio','in',('0','1','2'))]}"/>
thanks,