تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1399 أدوات العرض

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

الصورة الرمزية
إهمال
أفضل إجابة

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! 

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
أغسطس 25
271
2
يونيو 25
544
1
يونيو 25
2502
1
يونيو 25
603
2
مايو 25
682