Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1456 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
ago 25
389
2
jun 25
650
1
jun 25
2566
1
jun 25
704
2
may 25
739