good night,
please request your support, thank you very much.
When I open a new invoice, I want to hide a field in the invoice according to a value of another model. I am trying with:
class ResCompany(models.Model):
_inherit="res.company"
tipo_envio = fields.Selection(selection=[("0","p"),("3","a")])
class AccountInvoice(models.Model):
_inherit = "account.invoice"
related_tipo_envio = fields.Selection(related="company_id.tipo_envio",store=True)
tipo = fields.Selection(selection=[("01","cat"),("02","dog")],default="01",required=True,copy=False)
<xpath expr="//field[@name='date_due']" position="after">
<field name="related_tipo_envio" invisible="1"/>
<field name="tipo" string="Tipo" attrs="{'readonly':[['state','not in',['draft']]],'invisible':[('related_tipo_envio','=','3')]}" />
but the "type" field that I want to hide is always visible.
that could be happening? or that may be missing.
Thank you.
Check odoo customization tips: https://goo.gl/8HgnCF