This question has been flagged
3 Replies
3776 Views

Hello, I havea little problem with a view, I need that a text field will be invisible if the Leads or Opportunities is dead or lost, I try this:

<field name="cancel_reason"  placeholder="Reason for cancellation" nolabel="1" attrs="{'invisible' : [('probability', '=', 0), ('stage_id.fold', '=', True)]}"/> --> Obviously fails

<field name="cancel_reason"  placeholder="Reason for cancellation" nolabel="1" attrs="{'invisible' : [('probability', '=', 0)]}"/> --> but the news leads or Opportunities see the field

The stage_id field is very variable, I don't  know how to validate.

Thanks!

Avatar
Discard

Why not do a check on the state field?

Author

because the state field has been delete in the CRM 8.0, I validated with a functional field =)

Best Answer

I Know that it's too late to answer just if someone need it :

<field name="Your_Field" attrs="{'invisible': ['|', ('probability', '>', 0), ('active', '=', True)]}"/>

Like this when the opportunities is lost youre field turn to invisible 


Avatar
Discard