Skip to Content
Menu
This question has been flagged

I have a decorator in odoo for warehouse_id mapping, here is an example


<field name="warehouse_id" widget="badge"

decoration-success="warehouse_id == '1'"

decoration-info="warehouse_id == '5'"

decoration-primary="warehouse_id == '9'"/>


the question is how to use decoration other than the colors in bootstrap? thanks

Avatar
Discard
Best Answer

There are already those decorators that you can use: 

  • decoration-success: light green
  • decoration-primary: light purple
  • decoration-info: light blue
  • decoration-muted: light gray
  • decoration-warning: light brown
  • decoration-danger: light red
  • decoration-bf: Bold text
  • decoration-it:  Italic text

If you want to change the color of the standard decorator, you can add a scss file in static/src/scss, and don't forget to add it in the assets of your manifest.

.o_data_row.decoration-success {
background-color: #ffcccc !important;
}

I hope this helps! 

Avatar
Discard
Author Best Answer

Thanks for helping, can we add custom decoration on odoo too? for example

<field name="warehouse_id" widget="badge" decoration-unsuccess="warehouse_id == '1'" />

thanks

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 25
1223
0
Mar 25
561
0
Jan 25
559
0
Jan 25
471
1
May 25
18