Skip to Content
Menu
This question has been flagged

I want to change the color of the gantt view in the workorders, but I don't know how I can change them. In the default setting it's showing a new color for every "production_id" because the gantt view has the tag (color="production_id").
In this gantt view there are a lot of "decorations" based on the state of the workorder. 

Is there a way to define a new color for a specific state or to style the decorations larger then this default little triangle?

I want a new color that is filled the complete bar of the workorders based on the state.


<gantt class="o_mrp_workorder_gantt" date_stop="date_planned_finished" date_start="date_planned_start" string="Operations" default_group_by="workcenter_id" create="0" progress="progress" plan="0" decoration-danger="date_planned_start &lt; current_date and state in ['pending', 'ready']" decoration-success="state == 'ready'" decoration-warning="state == 'cancel'" color="production_id">

Thank you




Avatar
Discard
Best Answer

You will find this implemented on the 'planning.role' model in odoo. You must define an integer field on your model.

color = fields.Integer("Color", default=0)

You can then add the field to a form view on the model and use the color_picker widget. 


There are 12 colors available with the color picker widget. You may want to add the color field to the mrp.workcenter model and then create a related field  back to the mrp.workorder model.


Avatar
Discard
Related Posts Replies Views Activity
1
Jul 22
3593
0
Nov 23
1178
0
Apr 23
1423
0
Jan 23
1422
1
Apr 21
4901