[MIG] web_dashboard_tile from 12.0 to 16.0

- remove 12.0 migration scripts
- bump version to 16.0
- use new api convention @api.model_create_multi ; new compute function logic ;
- add dependency to spreasheet_dashboard to use 'Dashboard' main menu item
- use new way to include assets
- remove totally useless controllers
- distinct different errors, depending on domain or format errors
- fix : _compute_data depends on many fields
- update : documentation and printscreens
This commit is contained in:
Sylvain LE GAL
2022-10-26 21:05:31 +02:00
parent 0d15ce1df8
commit dd52e48dce
26 changed files with 272 additions and 320 deletions

View File

@@ -2,17 +2,10 @@
<odoo>
<menuitem
id="menu_dashboard_tile"
parent="base.menu_board_root"
name="Overview"
sequence="0"
/>
<menuitem
id="menu_dashboard_tile_settings"
parent="base.menu_board_root"
name="Settings"
sequence="100"
id="menu_tile_configuration"
name="Overview Settings"
parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_configuration"
sequence="160"
/>
</odoo>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link
rel="stylesheet"
href="/web_dashboard_tile/static/src/css/web_dashboard_tile.css"
/>
</xpath>
</template>
</odoo>

View File

@@ -4,7 +4,6 @@
<record id="action_category_2_tile" model="ir.actions.act_window">
<field name="name">Dashboard Items</field>
<field name="res_model">tile.tile</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_category_id': active_id}</field>
</record>
@@ -15,18 +14,6 @@
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button
name="toggle_active"
type="object"
class="oe_stat_button"
icon="fa-archive"
>
<field
name="active"
widget="boolean_button"
options="{&quot;terminology&quot;: &quot;archive&quot;}"
/>
</button>
<button
class="oe_stat_button"
type="action"
@@ -37,11 +24,18 @@
<field string="Items" name="tile_qty" widget="statinfo" />
</button>
</div>
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<div class="oe_title">
<label for="name" class="oe_edit_only" />
<h1><field name="name" required="1" /></h1>
</div>
<group string="Technical Informations">
<field name="active" invisible="1" />
<field name="menu_id" />
<field name="action_id" />
</group>
@@ -65,16 +59,15 @@
<record model="ir.actions.act_window" id="action_tile_category">
<field name="name">Dashboard Categories</field>
<field name="res_model">tile.category</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form</field>
<field name="context">{'active_test': False}</field>
</record>
<menuitem
id="menu_tile_category"
parent="menu_dashboard_tile_settings"
parent="menu_tile_configuration"
action="action_tile_category"
sequence="50"
sequence="160"
/>
</odoo>

View File

@@ -35,27 +35,30 @@
<field name="model">tile.tile</field>
<field name="arch" type="xml">
<form>
<field name="model_name" invisible="1" />
<sheet>
<h1>
<field name="name" />
</h1>
<group>
<field name="category_id" />
<field name="user_id" />
</group>
<group col="4">
<separator string="Display" colspan="4" />
<group col="4" string="Display">
<field name="category_id" colspan="4" />
<field name="background_color" widget="color" />
<field name="font_color" widget="color" />
<separator string="Technical Informations" colspan="4" />
</group>
<group col="4" string="Technical Informations">
<field name="model_id" />
<field name="action_id" />
<field name="domain" colspan="4" />
<field name="model_name" invisible="1" />
<separator colspan="4" />
<field
name="error"
attrs="{'invisible':[('error','=',False)]}"
name="domain"
colspan="4"
widget="ace"
option="{'mode': 'python'}"
/>
<field
name="domain_error"
attrs="{'invisible':[('domain_error','=',False)]}"
nolabel="1"
colspan="4"
/>
</group>
<notebook>
@@ -83,6 +86,12 @@
attrs="{'invisible':[('primary_value','=',False)]}"
/>
</group>
<group>
<field
name="primary_error"
attrs="{'invisible': [('primary_error', '=', False)]}"
/>
</group>
</group>
<group string="Secondary Value">
<group>
@@ -106,10 +115,17 @@
attrs="{'invisible':[('secondary_value','=',False)]}"
/>
</group>
<group>
<field
name="secondary_error"
attrs="{'invisible': [('secondary_error', '=', False)]}"
/>
</group>
</group>
</page>
<page string="Security">
<field name="group_ids" />
<field name="user_id" />
</page>
</notebook>
</sheet>
@@ -193,15 +209,23 @@
<record model="ir.actions.act_window" id="action_tile_tile">
<field name="name">Dashboard Items</field>
<field name="res_model">tile.tile</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,kanban</field>
</record>
<menuitem
id="menu_tile_tile"
parent="menu_dashboard_tile_settings"
parent="menu_tile_configuration"
action="action_tile_tile"
sequence="10"
sequence="161"
/>
<!-- Root menu item that will contains all the sub menu entries
that contains tiles -->
<menuitem
id="menu_dashboard_tile"
parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_root"
name="Overview"
sequence="0"
/>
</odoo>