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.

94 lines
1.8 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. Credits
  47. =======
  48. Contributors
  49. ------------
  50. * Adil Houmadi <adil.houmadi@gmail.com>
  51. Maintainer
  52. ----------
  53. .. image:: http://odoo-community.org/logo.png
  54. :alt: Odoo Community Association
  55. :target: http://odoo-community.org
  56. This module is maintained by the OCA.
  57. OCA, or the Odoo Community Association, is a nonprofit organization whose
  58. mission is to support the collaborative development of Odoo features and
  59. promote its widespread use.
  60. To contribute to this module, please visit http://odoo-community.org.