diff --git a/web_dashboard_tile/__openerp__.py b/web_dashboard_tile/__openerp__.py index 6d6e86f7..935fbb29 100644 --- a/web_dashboard_tile/__openerp__.py +++ b/web_dashboard_tile/__openerp__.py @@ -22,8 +22,13 @@ ############################################################################## { "name": "Dashboard Tile", - "version": "0.4", - "depends": ['web', 'board', 'mail'], + "version": "1.0", + "depends": [ + 'web', + 'board', + 'mail', + 'web_widget_color', + ], 'author': "initOS GmbH & Co. KG,GRAP,Odoo Community Association (OCA)", "category": "", 'license': 'AGPL-3', diff --git a/web_dashboard_tile/demo/tile_tile.yml b/web_dashboard_tile/demo/tile_tile.yml index c268e9ea..c40b5903 100644 --- a/web_dashboard_tile/demo/tile_tile.yml +++ b/web_dashboard_tile/demo/tile_tile.yml @@ -25,11 +25,9 @@ model_id: base.model_ir_module_module domain: [['state', 'in', ['installed', 'to upgrade', 'to remove']]] action_id: base.open_module_tree - color: 1 - !record {model: tile.tile, id: installed_OCA_modules}: name: Installed OCA Modules model_id: base.model_ir_module_module domain: [['state', 'in', ['installed', 'to upgrade', 'to remove']], ['author', 'ilike', 'Odoo Community Association (OCA)']] action_id: base.open_module_tree - color: 2 diff --git a/web_dashboard_tile/migrations/7.0.1.0/post-migration-color.py b/web_dashboard_tile/migrations/7.0.1.0/post-migration-color.py new file mode 100644 index 00000000..f8c33840 --- /dev/null +++ b/web_dashboard_tile/migrations/7.0.1.0/post-migration-color.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2015-Today GRAP +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +COLOR_NUMERIC_TO_RVB = { + 0: '#006015', + 1: '#CD2513', + 2: '#CDC713', + 3: '#57158A', + 4: '#0E9B2D', + 5: '#7F0C00', + 6: '#7F7B00', + 7: '#320455', + 8: '#CD6E13', + 9: '#0E6C7E', +} + + +def migrate_color(cr): + for old, new in COLOR_NUMERIC_TO_RVB.iteritems(): + cr.execute(""" + UPDATE tile_tile + SET color='%s', font_color='#FFFFFF' + WHERE color='%s' + """ % (new, old)) + + +def migrate(cr, installed_version): + migrate_color(cr) diff --git a/web_dashboard_tile/static/src/css/tile.css b/web_dashboard_tile/static/src/css/tile.css index 06c23705..9158f5bd 100644 --- a/web_dashboard_tile/static/src/css/tile.css +++ b/web_dashboard_tile/static/src/css/tile.css @@ -1,7 +1,7 @@ .openerp .oe_kanban_view .oe_dashbaord_tile{ width: 150px; height: 150px; - border: 0; + border: 1px solid; border-radius: 0; } .openerp .oe_kanban_view .oe_dashbaord_tile .tile_count{ @@ -14,62 +14,4 @@ .openerp .oe_kanban_view .oe_dashbaord_tile .tile_label{ padding: 9px; font-size: 15px; -} -.openerp .oe_kanban_view .oe_dashbaord_tile a{ - color: #fff; -} -.openerp .oe_kanban_view .oe_dashbaord_tile.oe_tile_color_, -.openerp .oe_kanban_view .oe_dashbaord_tile.oe_tile_color_ a, -.openerp .oe_kanban_view .oe_dashbaord_tile .oe_dropdown_menu a{ - color: #000; -} -.openerp .oe_kanban_view .oe_tile_color_1, -.openerp .oe_dashbaord_tile a.oe_kanban_color_1{ - background: #CD2513; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_2, -.openerp .oe_dashbaord_tile a.oe_kanban_color_2{ - background: #CDC713; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_3, -.openerp .oe_dashbaord_tile a.oe_kanban_color_3{ - background: #57158A; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_4, -.openerp .oe_dashbaord_tile a.oe_kanban_color_4{ - background: #0E9B2D; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_5, -.openerp .oe_dashbaord_tile a.oe_kanban_color_5{ - background: #7F0C00; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_6, -.openerp .oe_dashbaord_tile a.oe_kanban_color_6{ - background: #7F7B00; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_7, -.openerp .oe_dashbaord_tile a.oe_kanban_color_7{ - background: #320455; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_8, -.openerp .oe_dashbaord_tile a.oe_kanban_color_8{ - background: #CD6E13; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_9, -.openerp .oe_dashbaord_tile a.oe_kanban_color_9{ - background: #0E6C7E; - color: #fff; -} -.openerp .oe_kanban_view .oe_tile_color_0, -.openerp .oe_dashbaord_tile a.oe_kanban_color_0{ - background: #006015; - color: #fff; } \ No newline at end of file diff --git a/web_dashboard_tile/tile.py b/web_dashboard_tile/tile.py index 0c55e81e..22825c6a 100644 --- a/web_dashboard_tile/tile.py +++ b/web_dashboard_tile/tile.py @@ -74,14 +74,16 @@ class tile(orm.Model): 'active': fields.function( _get_tile_info, type='boolean', string='Active', multi='tile_info', readonly=True, fnct_search=_search_active), - 'color': fields.char('Kanban Color'), + 'color': fields.char('Background color'), + 'font_color': fields.char('Font Color'), 'sequence': fields.integer( 'Sequence', required=True), } _defaults = { 'domain': '[]', - 'color': 0, + 'color': '#0E6C7E', + 'font_color': '#FFFFFF', 'sequence': 0, } diff --git a/web_dashboard_tile/tile.xml b/web_dashboard_tile/tile.xml index d5ce4c21..8872391c 100644 --- a/web_dashboard_tile/tile.xml +++ b/web_dashboard_tile/tile.xml @@ -27,6 +27,8 @@ + + @@ -44,11 +46,11 @@ + -
- +
+
í
    @@ -58,7 +60,7 @@