Migration of web_widget_color to 10.0 (#439)

[MIG] web_widget_color: Migration to 10.0
This commit is contained in:
Adrien Peiffer (ACSONE)
2016-10-12 10:54:45 +02:00
committed by Enric Tobella
parent f5bb54524e
commit 7cbe041756
3 changed files with 18 additions and 12 deletions

View File

@@ -64,15 +64,17 @@ In the view declaration, put widget='color' attribute in the field tag::
.. |formview| image:: ./images/form_view.png .. |formview| image:: ./images/form_view.png
.. |listview| image:: ./images/list_view.png .. |listview| image:: ./images/list_view.png
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/10.0
Bug Tracker Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. Bugs are tracked on `GitHub Issues
In case of trouble, please check there if your issue has already been reported. <https://github.com/OCA/OCA/issues>`_. In case of trouble, please
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback check there if your issue has already been reported. If you spotted it first,
`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**>`_. help us smashing it by providing a detailed and welcomed feedback.
Credits Credits
======= =======
@@ -86,9 +88,9 @@ Contributors
Maintainer Maintainer
---------- ----------
.. image:: http://odoo-community.org/logo.png .. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association :alt: Odoo Community Association
:target: http://odoo-community.org :target: https://odoo-community.org
This module is maintained by the OCA. This module is maintained by the OCA.
@@ -96,4 +98,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
To contribute to this module, please visit http://odoo-community.org. To contribute to this module, please visit https://odoo-community.org.

View File

@@ -8,7 +8,7 @@
{ {
'name': "Web Widget Color", 'name': "Web Widget Color",
'category': "web", 'category': "web",
'version': "9.0.1.0.0", 'version': "10.0.1.0.0",
"author": "Savoir-faire Linux, " "author": "Savoir-faire Linux, "
"Anybox, " "Anybox, "
"Taktik SA, " "Taktik SA, "
@@ -23,6 +23,6 @@
], ],
'license': 'AGPL-3', 'license': 'AGPL-3',
'auto_install': False, 'auto_install': False,
'installable': False, 'installable': True,
'web_preload': True, 'web_preload': True,
} }

View File

@@ -61,7 +61,7 @@ odoo.define('web.web_widget_color', function(require) {
jscolor.init(this.$el[0]); jscolor.init(this.$el[0]);
} else { } else {
this.$(".oe_form_char_content").text(show_value); this.$(".oe_form_char_content").text(show_value);
this.$('div').css("background-color", show_value); this.$('span').css("background-color", show_value);
} }
} }
}); });
@@ -72,7 +72,11 @@ odoo.define('web.web_widget_color', function(require) {
* Init jscolor for each editable mode on view form * Init jscolor for each editable mode on view form
*/ */
FormView.include({ FormView.include({
to_edit_mode: function () { on_button_edit: function () {
this._super();
jscolor.init(this.$el[0]);
},
on_button_create: function () {
this._super(); this._super();
jscolor.init(this.$el[0]); jscolor.init(this.$el[0]);
} }