I run an insurance agency and I'm using Odoo 14CE to manage our client profiles, and I'm trying to figure out how to make a many2one field show in red if the client is taking a medication that's on the declinable list. I have my model created as x_meds and several many2one fields created as x_med1, x_med2, x_med3, etc. that all reference x_meds.
What I want is for certain records in the x_meds model to display in red if they will cause the client to get declined on an application. e.g, if the agent enters carvedilol in x_med1 and amlodipine in x_med2 that's fine, but if she enters gabapentin in x_med3 I want it to be flagged so the agent knows right away there is a problem without having to look up each drug manually. Is it possible to do this kind of conditional formatting on a many2one field?
Thanks! I will try these and report results.
I don't have enough karma to reply directly, but I think decoration-danger is what I want. However, all the examples I can find of its use are for a numeric value and not a text string. What would be the syntax to apply it if a text string is found anywhere in the value?