I have a problem with passing value for colors argument in my view element. So i have my model which has a function to return colors:
class MyTask(models.Model):
_inherit = "project.task"
is_special=fields.Boolean()
@api.model
def get_colors(self):
return 'red: is_special == true;'
And I also have got my view which looks like this:
<record id="my_module_timeline" model="ir.ui.view">
<field name="model">project.task</field>
<field name="type">timeline</field>
<field name="arch" type="xml">
<timeline date_start="date_start"
date_stop="date_end"
default_group_by="project_id"
event_open_popup="true"
colors= <-- how can i get the value from my model get_colors() function?
>
</timeline>
</field>
colors argument has to be string, and it cannot be a field of model. I tried a lot options to get this string from model function, but without good results.
<timeline>
element is just example it can be also tree, calendar etc.
For tests i got it from:
https://github.com/OCA/web/tree/11.0/web_timeline
It is possible in this way?
Thank you.