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.

140 lines
3.4 KiB

  1. # -*- encoding: utf-8 -*-
  2. ############################################################################
  3. #
  4. # Odoo, Open Source Web Widget Color
  5. # Copyright (C) 2012 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
  6. # Copyright (C) 2014 Anybox <http://anybox.fr>
  7. # Copyright (C) 2015 Taktik SA <http://taktik.be>
  8. #
  9. # This program is free software: you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as
  11. # published by the Free Software Foundation, either version 3 of the
  12. # License, or (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # @author Étienne Beaudry Auger <etienne.b.auger@savoirfairelinux.com>
  23. # @author Adil Houmadi <ah@taktik.be>
  24. #
  25. ##############################################################################
  26. {
  27. 'name': "Web Widget Color",
  28. 'category': "web",
  29. 'version': "1.0",
  30. 'depends': ['base', 'web'],
  31. 'description': '''
  32. Color widget for Odoo web client
  33. ================================
  34. This module aims to add a color picker to Odoo.
  35. It's a `jsColor <http://jscolor.com/>`_ lib integration.
  36. Features
  37. ========
  38. * The picker allow the user to quickly select a color on edit mode
  39. |picker|
  40. .. note::
  41. Notice how html code and the background color is updating when selecting
  42. a color.
  43. * Display the color on form view when you are not editing it
  44. |formview|
  45. * Display the color on list view to quickly find what's wrong!
  46. |listview|
  47. Requirements
  48. ============
  49. This module has been ported to 8.0
  50. Usage
  51. =====
  52. You need to declare a char field of at least size 7::
  53. _columns = {
  54. 'color': fields.char(
  55. u"Couleur",
  56. help=u"Toutes couleur valid css, exemple blue ou #f57900"
  57. ),
  58. }
  59. OR
  60. color = fields.Char(
  61. string="Color",
  62. help="Choose your color"
  63. )
  64. In the view declaration, put widget='color' attribute in the field tag::
  65. ...
  66. <field name="arch" type="xml">
  67. <tree string="View name">
  68. ...
  69. <field name="name"/>
  70. <field name="color" widget="color"/>
  71. ...
  72. </tree>
  73. </field>
  74. ...
  75. .. |picker| image:: /web_widget_color/static/src/img/picker.png
  76. .. |formview| image:: /web_widget_color/static/src/img/form_view.png
  77. .. |listview| image:: /web_widget_color/static/src/img/list_view.png
  78. Credits
  79. =======
  80. Contributors
  81. ------------
  82. * Adil Houmadi <adil.houmadi@gmail.com>
  83. Maintainer
  84. ----------
  85. .. image:: http://odoo-community.org/logo.png
  86. :alt: Odoo Community Association
  87. :target: http://odoo-community.org
  88. This module is maintained by the OCA.
  89. OCA, or the Odoo Community Association, is a nonprofit organization whose
  90. mission is to support the collaborative development of Odoo features and
  91. promote its widespread use.
  92. To contribute to this module, please visit http://odoo-community.org.''',
  93. 'qweb': [
  94. 'static/src/xml/widget.xml',
  95. ],
  96. 'css': [
  97. 'static/src/css/widget.css',
  98. ],
  99. 'js': [
  100. 'static/lib/jscolor/jscolor.js',
  101. 'static/src/js/widget.js',
  102. ],
  103. 'auto_install': False,
  104. 'installable': True,
  105. 'web_preload': True,
  106. }