You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.2 KiB

  1. Colorize field in tree views
  2. ============================
  3. This module aims to add support for dynamically coloring fields in tree view
  4. according to data in the record.
  5. It provides new attributes with the same syntax as 'colors' attribute in tree tag.
  6. Features
  7. ========
  8. * Add attribute 'bg_color' to color background of a cell in tree view
  9. * Add attribute 'fg_color' to change text color of a cell in tree view
  10. Usage
  11. =====
  12. * In the tree view declaration, put bg_color="red:customer==True;" attribute in the field tag::
  13. ...
  14. <field name="arch" type="xml">
  15. <tree string="View name">
  16. ...
  17. <field name="name" bg_color="red:customer==True;"/>
  18. ...
  19. </tree>
  20. </field>
  21. ...
  22. With this example, column which renders 'name' field will have its background colored in red.
  23. * In the tree view declaration, put fg_color="white:customer==True;" attribute in the field tag::
  24. ...
  25. <field name="arch" type="xml">
  26. <tree string="View name">
  27. ...
  28. <field name="name" fg_color="white:customer==True;"/>
  29. ...
  30. </tree>
  31. </field>
  32. ...
  33. With this example, column which renders 'name' field will have its text colored in white.
  34. Bug Tracker
  35. ===========
  36. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  37. In case of trouble, please check there if your issue has already been reported.
  38. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  39. `here <https://github.com/OCA/web/issues/new?body=module:%20web_widget_color_tree_field%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  40. Credits
  41. =======
  42. Contributors
  43. ------------
  44. * Damien Crier <damien.crier@camptocamp.com>
  45. Maintainer
  46. ----------
  47. .. image:: http://odoo-community.org/logo.png
  48. :alt: Odoo Community Association
  49. :target: http://odoo-community.org
  50. This module is maintained by the OCA.
  51. OCA, or the Odoo Community Association, is a nonprofit organization whose
  52. mission is to support the collaborative development of Odoo features and
  53. promote its widespread use.
  54. To contribute to this module, please visit http://odoo-community.org.