Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12.0 mig web dashboard tile #1428

Merged
merged 48 commits into from
Nov 26, 2021

Conversation

legalsylvain
Copy link
Contributor

@legalsylvain legalsylvain commented Nov 6, 2019

  • Migration of web_dashboard_tile to V12.
  • Only the last commit has be reviewed : 698433e

CC : co original author : @ivantodorovich

CC : @quentinDupont,

Description

Adds a dashboard where you can configure tiles from any view and add them as short cut.

By default, the tile displays items count of a given model restricted to a given domain.

Optionally, the tile can display the result of a function on a field.

  • Function is one of sum, avg, min, max or median.
  • Field must be integer or float.

Tile can be:

  • Displayed only for a user.
  • Global for all users.
  • Restricted to some groups.

Note: The tile will be hidden if the current user doesn't have access to the given model.

Configuration

First, you have to create tile categories.

  • Go to "Dashboards > Settings > Dashboard Categories"
  • Click on Create
  • Set a name, and save.

Odoo menu and action are automatically created. You should refresh your browser to see new menu items.

tile_category_form

Then you can create tiles.

  • go to "Dashboards > Settings > Dashboard Tiles"
  • create a new tile, set a name, a category and a model.
  • You can optionally define colors, domain a specific action to use.
  • Setting a user, or a group in "Security" tab will restrict the display of the tile.

tile_tile_form

You can optionally define a secondary value, for that purpose :

  • Select a field, a function to apply.
  • You can define a specific format. (.format() python syntax)

tile_tile_form_secondary_value

Usage

  • Go to "Dashboard > Overview" and select a category
  • The tile configured is displayed with the up to date count and average values of the selected domain.

tile_tile_kanban

  • By clicking on the item, you'll navigate to the tree view of the according model.

tile_tile_2_tree_view

Note

When you are in a tree view, with a domain, you can save it in the favorite menu, but the configuration is limited.

favorite_menu_create_tile

favorite_menu_create_tile_result

Migration Changes

  • Rename "dashboard tile" to "overview dashboard", that make more sense, and is more easy to translate.
  • refactor tile category
  • improve description
  • add legalsylvain as maintainer
  • update code and translation

@legalsylvain legalsylvain added this to the 12.0 milestone Nov 6, 2019
@OCA-git-bot OCA-git-bot mentioned this pull request Nov 6, 2019
40 tasks
@legalsylvain legalsylvain force-pushed the 12.0-mig-web_dashboard_tile branch 3 times, most recently from 341f97e to 8f7edfe Compare September 10, 2020 13:03
@legalsylvain legalsylvain force-pushed the 12.0-mig-web_dashboard_tile branch 3 times, most recently from 101432e to 698433e Compare August 2, 2021 16:36
@legalsylvain legalsylvain marked this pull request as ready for review August 2, 2021 16:38
Copy link
Contributor

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick review but LGTM 👍

Comment on lines 15 to 19
"contributors": [
"initOS GmbH & Co. KG",
"GRAP",
"Iván Todorovich <[email protected]>",
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this key even used? 🤔 I guess we should move this to CONTRIBUTORS.rst

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put values in authors keys.

web_dashboard_tile/models/tile_category.py Outdated Show resolved Hide resolved
Comment on lines +76 to +80
for category in self:
if category.menu_id:
category.menu_id.unlink()
if category.action_id:
category.action_id.unlink()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for category in self:
if category.menu_id:
category.menu_id.unlink()
if category.action_id:
category.action_id.unlink()
self.menu_id.unlink()
self.action_id.unlink()

Copy link
Contributor Author

@legalsylvain legalsylvain Aug 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is unlink working for 0 items ? i added test in V8 because there was some trouble if no action or menu was present.
maybe it's an obsolete problem. (don't tested).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it works :) unlink on an empty recordset simply doesn't do anything

https://github.com/odoo/odoo/blob/c164a46500e35b0120dedbcfe8e3faa2001461bf/odoo/models.py#L3158-L3159

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your answer.

@legalsylvain legalsylvain force-pushed the 12.0-mig-web_dashboard_tile branch 2 times, most recently from 524f5e8 to 124f335 Compare August 18, 2021 18:28
Copy link
Contributor

@quentinDupont quentinDupont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionnal review ✔️
We use this module in production server since one year and it is working greeaat

@legalsylvain legalsylvain force-pushed the 12.0-mig-web_dashboard_tile branch from 124f335 to ac41778 Compare October 21, 2021 17:52
…he fly tiles, but that was limited regarding configuration
Copy link
Member

@marcelsavegnago marcelsavegnago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dreispt
Copy link
Member

dreispt commented Nov 26, 2021

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 12.0-ocabot-merge-pr-1428-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit f323800 into OCA:12.0 Nov 26, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 9452113. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.