Browse Source

Added tile categories.

pull/868/head
Iván Todorovich 7 years ago
committed by Sylvain LE GAL
parent
commit
481b74a0e8
  1. 1
      web_dashboard_tile/__openerp__.py
  2. 29
      web_dashboard_tile/demo/tile_category.yml
  3. 3
      web_dashboard_tile/demo/tile_tile.yml
  4. 2
      web_dashboard_tile/models/__init__.py
  5. 17
      web_dashboard_tile/models/tile_category.py
  6. 1
      web_dashboard_tile/models/tile_tile.py
  7. 1
      web_dashboard_tile/security/ir.model.access.csv
  8. 32
      web_dashboard_tile/views/tile.xml

1
web_dashboard_tile/__openerp__.py

@ -30,6 +30,7 @@
],
'demo': [
'demo/res_groups.yml',
'demo/tile_category.yml',
'demo/tile_tile.yml',
],
'qweb': [

29
web_dashboard_tile/demo/tile_category.yml

@ -0,0 +1,29 @@
# -*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
- !record {model: tile.category, id: modules}:
name: Modules
sequence: 0
- !record {model: tile.category, id: finance}:
name: Finance
sequence: 1

3
web_dashboard_tile/demo/tile_tile.yml

@ -22,18 +22,21 @@
- !record {model: tile.tile, id: installed_modules}:
name: Installed Modules
category_id: modules
model_id: base.model_ir_module_module
domain: [['state', 'in', ['installed', 'to upgrade', 'to remove']]]
action_id: base.open_module_tree
- !record {model: tile.tile, id: installed_OCA_modules}:
name: Installed OCA Modules
category_id: 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
- !record {model: tile.tile, id: all_currency_with_rate}:
name: Currencies (Max Rate)
category_id: finance
model_id: base.model_res_currency
domain: []
secondary_function: max

2
web_dashboard_tile/models/__init__.py

@ -4,4 +4,4 @@
# © 2015-Today GRAP
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import tile_tile
from . import tile_tile, tile_category

17
web_dashboard_tile/models/tile_category.py

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# © 2018 Iván Todorovich <ivan.todorovich@gmail.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, models
class TileCategory(models.Model):
_name = 'tile.category'
_description = 'Dashboard Tile Category'
_order = 'sequence asc'
name = fields.Char(required=True)
sequence = fields.Integer(
help="Used to order the tile categories",
default=0)
fold = fields.Boolean('Folded by default')

1
web_dashboard_tile/models/tile_tile.py

@ -77,6 +77,7 @@ class TileTile(models.Model):
# Column Section
name = fields.Char(required=True)
sequence = fields.Integer(default=0, required=True)
category_id = fields.Many2one('tile.category', 'Category')
user_id = fields.Many2one('res.users', 'User')
background_color = fields.Char(default='#0E6C7E', oldname='color')
font_color = fields.Char(default='#FFFFFF')

1
web_dashboard_tile/security/ir.model.access.csv

@ -1,2 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
tile_user,tile_user,model_tile_tile,base.group_user,1,1,1,1
tile_user_category,tile_user,model_tile_category,base.group_user,1,1,1,1

32
web_dashboard_tile/views/tile.xml

@ -27,11 +27,14 @@
<h1>
<field name="name"/>
</h1>
<group>
<field name="category_id"/>
<field name="user_id"/>
</group>
<group col="4">
<separator string="Display" colspan="4"/>
<field name="background_color" widget="color"/>
<field name="font_color" widget="color"/>
<field name="user_id"/>
<separator string="Technical Informations" colspan="4"/>
<field name="model_id"/>
<field name="action_id"/>
@ -85,12 +88,13 @@
</field>
</record>
<!-- CRM Lead Kanban View -->
<!-- Kanban View -->
<record model="ir.ui.view" id="dashboard_tile_tile_kanban_view">
<field name="model">tile.tile</field>
<field name="arch" type="xml">
<kanban class="o_kanban_small_column">
<kanban default_group_by="category_id" create="false" class="o_kanban_small_column">
<field name="name"/>
<field name="category_id"/>
<field name="domain"/>
<field name="model_id"/>
<field name="action_id"/>
@ -142,6 +146,28 @@
</field>
</record>
<record model="ir.ui.view" id="dashboard_tile_category_form_view">
<field name="model">tile.category</field>
<field name="arch" type="xml">
<form string="Stage of Notes">
<group>
<field name="name"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="dashboard_tile_category_tree_view">
<field name="model">tile.category</field>
<field name="arch" type="xml">
<tree string="Tile Categories" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="fold"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_tree_dashboard_tile">
<field name="name">Dashboard</field>
<field name="res_model">tile.tile</field>

Loading…
Cancel
Save