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.

100 lines
2.3 KiB

  1. Color widget for Odoo web client
  2. ================================
  3. This module aims to add a color picker to Odoo.
  4. It's a `jsColor <http://jscolor.com/>`_ lib integration.
  5. Features
  6. ========
  7. * The picker allow the user to quickly select a color on edit mode
  8. |picker|
  9. .. note::
  10. Notice how html code and the background color is updating when selecting a color.
  11. * Display the color on form view when you are not editing it
  12. |formview|
  13. * Display the color on list view to quickly find what's wrong!
  14. |listview|
  15. Usage
  16. =====
  17. You need to declare a char field::
  18. color = fields.Char(
  19. string="Color",
  20. help="Choose your color"
  21. )
  22. In the view declaration, put widget='color' attribute in the field tag::
  23. ...
  24. <field name="arch" type="xml">
  25. <tree string="View name">
  26. ...
  27. <field name="color" widget="color"/>
  28. ...
  29. </tree>
  30. </field>
  31. ...
  32. <field name="arch" type="xml">
  33. <form string="View name">
  34. ...
  35. <field name="color" widget="color"/>
  36. ...
  37. </form>
  38. </field>
  39. ...
  40. .. |picker| image:: ./images/picker.png
  41. .. |formview| image:: ./images/form_view.png
  42. .. |listview| image:: ./images/list_view.png
  43. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  44. :alt: Try me on Runbot
  45. :target: https://runbot.odoo-community.org/runbot/162/11.0
  46. Bug Tracker
  47. ===========
  48. Bugs are tracked on `GitHub Issues
  49. <https://github.com/OCA/OCA/issues>`_. In case of trouble, please
  50. check there if your issue has already been reported. If you spotted it first,
  51. help us smashing it by providing a detailed and welcomed feedback.
  52. Credits
  53. =======
  54. Contributors
  55. ------------
  56. * Adil Houmadi <adil.houmadi@gmail.com>
  57. * Enric Tobella <etobella@creublanca.es>
  58. * Nicolas JEUDY (Sudokeys) <https://www.github.com/njeudy>
  59. Maintainer
  60. ----------
  61. .. image:: https://odoo-community.org/logo.png
  62. :alt: Odoo Community Association
  63. :target: https://odoo-community.org
  64. This module is maintained by the OCA.
  65. OCA, or the Odoo Community Association, is a nonprofit organization whose
  66. mission is to support the collaborative development of Odoo features and
  67. promote its widespread use.
  68. To contribute to this module, please visit https://odoo-community.org.