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.

104 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. Requirements
  16. ============
  17. This module has been ported to 8.0
  18. Usage
  19. =====
  20. You need to declare a char field of at least size 7::
  21. _columns = {
  22. 'color': fields.char(
  23. u"Couleur",
  24. help=u"Toutes couleur valid css, exemple blue ou #f57900"
  25. ),
  26. }
  27. OR
  28. color = fields.Char(
  29. string="Color",
  30. help="Choose your color"
  31. )
  32. In the view declaration, put widget='color' attribute in the field tag::
  33. ...
  34. <field name="arch" type="xml">
  35. <tree string="View name">
  36. ...
  37. <field name="name"/>
  38. <field name="color" widget="color"/>
  39. ...
  40. </tree>
  41. </field>
  42. ...
  43. .. |picker| image:: ./images/picker.png
  44. .. |formview| image:: ./images/form_view.png
  45. .. |listview| image:: ./images/list_view.png
  46. Bug Tracker
  47. ===========
  48. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  49. In case of trouble, please check there if your issue has already been reported.
  50. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  51. `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**>`_.
  52. Credits
  53. =======
  54. Contributors
  55. ------------
  56. * Adil Houmadi <adil.houmadi@gmail.com>
  57. Maintainer
  58. ----------
  59. .. image:: http://odoo-community.org/logo.png
  60. :alt: Odoo Community Association
  61. :target: http://odoo-community.org
  62. This module is maintained by the OCA.
  63. OCA, or the Odoo Community Association, is a nonprofit organization whose
  64. mission is to support the collaborative development of Odoo features and
  65. promote its widespread use.
  66. To contribute to this module, please visit http://odoo-community.org.