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.

99 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. Bug Tracker
  44. ===========
  45. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  46. In case of trouble, please check there if your issue has already been reported.
  47. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  48. `here <https://github.com/OCA/web/issues/new?body=module:%20web_widget_color%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  49. Credits
  50. =======
  51. Contributors
  52. ------------
  53. * Adil Houmadi <adil.houmadi@gmail.com>
  54. * Nicolas JEUDY (Sudokeys) <https://www.github.com/njeudy>
  55. Maintainer
  56. ----------
  57. .. image:: http://odoo-community.org/logo.png
  58. :alt: Odoo Community Association
  59. :target: http://odoo-community.org
  60. This module is maintained by the OCA.
  61. OCA, or the Odoo Community Association, is a nonprofit organization whose
  62. mission is to support the collaborative development of Odoo features and
  63. promote its widespread use.
  64. To contribute to this module, please visit http://odoo-community.org.