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.

72 lines
1.3 KiB

  1. ===========================
  2. Odoo web_widget_color module
  3. ===========================
  4. This module aims to add a color picker to Odoo.
  5. It's a `jsColor <http://jscolor.com/>`_ lib integration.
  6. Features
  7. ========
  8. * The picker allow the user to quickly select a color on edit mode
  9. |picker|
  10. .. note::
  11. Notice how html code and the background color is updating when selecting a color.
  12. * Display the color on form view when you are not editing it
  13. |formview|
  14. * Display the color on list view to quickly find what's wrong!
  15. |listview|
  16. Requirements
  17. ============
  18. This module has been ported to 8.0
  19. Usage
  20. =====
  21. You need to declare a char field of at least size 7::
  22. _columns = {
  23. 'color': fields.char(
  24. u"Couleur",
  25. help=u"Toutes couleur valid css, exemple blue ou #f57900"
  26. ),
  27. }
  28. OR
  29. color = fields.Char(
  30. string="Color",
  31. help="Choose your color"
  32. )
  33. In the view declaration, put widget='color' attribute in the field tag::
  34. ...
  35. <field name="arch" type="xml">
  36. <tree string="View name">
  37. ...
  38. <field name="name"/>
  39. <field name="color" widget="color"/>
  40. ...
  41. </tree>
  42. </field>
  43. ...
  44. .. |picker| image:: ./doc/picker.png
  45. .. |formview| image:: ./doc/form_view.png
  46. .. |listview| image:: ./doc/list_view.png