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.

101 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 of at least size 7::
  18. _columns = {
  19. 'color': fields.char(
  20. u"Couleur",
  21. help=u"Toutes couleur valid css, exemple blue ou #f57900"
  22. ),
  23. }
  24. OR
  25. color = fields.Char(
  26. string="Color",
  27. help="Choose your color"
  28. )
  29. In the view declaration, put widget='color' attribute in the field tag::
  30. ...
  31. <field name="arch" type="xml">
  32. <tree string="View name">
  33. ...
  34. <field name="name"/>
  35. <field name="color" widget="color"/>
  36. ...
  37. </tree>
  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/10.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. * Nicolas JEUDY (Sudokeys) <https://www.github.com/njeudy>
  58. Maintainer
  59. ----------
  60. .. image:: https://odoo-community.org/logo.png
  61. :alt: Odoo Community Association
  62. :target: https://odoo-community.org
  63. This module is maintained by the OCA.
  64. OCA, or the Odoo Community Association, is a nonprofit organization whose
  65. mission is to support the collaborative development of Odoo features and
  66. promote its widespread use.
  67. To contribute to this module, please visit https://odoo-community.org.