I have a field in my XML that is sometimes a URL, sometimes a phone number. I want to apply the widget="url" when the field contains a website but not when the field contains a phone number. I have a second field that tells the user whether the field contains a phone number of website.
<field name="openerp_val" widget="url" string ="openerp_val" attrs="{'invisible': [('field_diff','=','website')]}"/>
<field name="openerp_val" string ="openerp_val" attrs="{'invisible': [('field_diff','!=','website')]}"/>
I have tried the above and will only show the type of field in the bottom line of code. I think the second line is over writing the first line.
So how can i have a field displayed iwth a widget like url based on a condition?
URL widget in Odoo: https://learnopenerp.blogspot.com/2022/05/how-to-use-phone-email-and-url-widget-in-odoo-15.html