Help

0

How to many2many field change color.

Avatar
Bhavin Vekariya
<field name="book_ids" widget="many2many_tags" options='{"color_field":"color"}'/>
This field name book_ids not show color in many2many relation.
also put a python file. not show color.
color = fields.Integer('color index')












 
1Comment
Avatar
Discard
Avatar
Divyansh Tripathi
-

Are you trying to change color of many2many tree view or tags or what?

1Answer
2

Hi,
Add default value for color field as shown below,

    def _get_default_color(self):
return randint(1, 11)

color = fields.Integer(string='Color Index', default=_get_default_color)

And by clicking on selected value on many2many field you can change the color.

Hope it helps

Avatar
Discard