Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion spreadsheet_dashboard_oca/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,34 @@ Spreadsheet Dashboard Oca
|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to edit spreadsheet dashboards using OCA Spreadsheet
editor.
editor. It also allows to manage the public share links of those
dashboards: list, copy, and revoke them. Dashboard admins can manage the
shares created by any user.

**Table of contents**

.. contents::
:local:

Configuration
=============

Users can only see and revoke the shares they created. Users in the
"Dashboards / Admin" group
(spreadsheet_dashboard.group_dashboard_manager) can see and revoke the
shares created by any user.

Usage
=====

- Open the "Dashboards" app (Rapor Panelleri).
- Open a dashboard and click on the **Share** button.
- Click on **Manage shares** to list every share link of the dashboard.
- Use the copy button to copy a link, or click **Revoke** to make a link
return a 404 error.
- A badge next to the dashboard name in the sidebar shows the number of
active shares.

Bug Tracker
===========

Expand Down
12 changes: 9 additions & 3 deletions spreadsheet_dashboard_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
{
"name": "Spreadsheet Dashboard Oca",
"summary": """
Use OCA Spreadsheets on dashboards configuration""",
"version": "19.0.1.0.0",
Use OCA Spreadsheets on dashboards configuration and manage
dashboard share links""",
"version": "19.0.2.0.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't change manually the module version. It's done by the bot. This is done for avoiding conflicts if other pull request touch the same module. Anyway, for now there's no conflict.

"license": "AGPL-3",
"author": "CreuBlanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/spreadsheet",
Expand All @@ -15,6 +16,7 @@
],
"data": [
"security/ir.model.access.csv",
"security/ir_rule.xml",
"wizards/spreadsheet_spreadsheet_import.xml",
"wizards/spreadsheet_to_dashboard.xml",
"views/spreadsheet_dashboard_group_views.xml",
Expand All @@ -26,8 +28,12 @@
(
"after",
"spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js",
"spreadsheet_dashboard_oca/static/src/bundle/*.js",
"spreadsheet_dashboard_oca/static/src/bundle/**/*.js",
),
"spreadsheet_dashboard_oca/static/src/bundle/**/*.xml",
],
"web.assets_unit_tests": [
"spreadsheet_dashboard_oca/static/tests/**/*",
],
},
}
62 changes: 62 additions & 0 deletions spreadsheet_dashboard_oca/i18n/spreadsheet_dashboard_oca.pot
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,23 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Actions"
msgstr ""

#. module: spreadsheet_dashboard_oca
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_dashboard__active
msgid "Active"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/dashboard_badge.xml:0
msgid "Active shares"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/spreadsheet_to_dashboard.esm.js:0
Expand All @@ -34,11 +46,28 @@ msgstr ""
msgid "Cancel"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Close"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.esm.js:0
msgid "Copied"
msgstr ""

#. module: spreadsheet_dashboard_oca
#: model_terms:ir.ui.view,arch_db:spreadsheet_dashboard_oca.spreadsheet_dashboard_tree_view
msgid "Copy"
msgstr ""

#. module: spreadsheet_dashboard_oca
#: model:ir.model,name:spreadsheet_dashboard_oca.model_spreadsheet_dashboard_share
msgid "Copy of a shared dashboard"
msgstr ""

#. module: spreadsheet_dashboard_oca
#: model_terms:ir.ui.view,arch_db:spreadsheet_dashboard_oca.spreadsheet_to_dashboard_view_form
msgid "Create"
Expand All @@ -50,17 +79,23 @@ msgid "Create dashboard from spreadsheet"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_to_dashboard__create_uid
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Created by"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_to_dashboard__create_date
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Created on"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_spreadsheet_import__dashboard_id
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Dashboard"
msgstr ""

Expand All @@ -81,6 +116,7 @@ msgstr ""

#. module: spreadsheet_dashboard_oca
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_dashboard__display_name
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_dashboard_share__display_name
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_spreadsheet_import__display_name
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_to_dashboard__display_name
msgid "Display Name"
Expand All @@ -93,6 +129,7 @@ msgstr ""

#. module: spreadsheet_dashboard_oca
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_dashboard__id
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_dashboard_share__id
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_spreadsheet_import__id
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_to_dashboard__id
msgid "ID"
Expand All @@ -113,6 +150,13 @@ msgstr ""
msgid "Last Updated on"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_button.xml:0
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_button_patch.esm.js:0
msgid "Manage shares"
msgstr ""

#. module: spreadsheet_dashboard_oca
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_dashboard__name
msgid "Name"
Expand All @@ -123,12 +167,30 @@ msgstr ""
msgid "New dashboard"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "No shares yet."
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Revoke"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-python
#: code:addons/spreadsheet_dashboard_oca/models/spreadsheet_dashboard.py:0
msgid "Search operation not supported"
msgstr ""

#. module: spreadsheet_dashboard_oca
#. odoo-javascript
#: code:addons/spreadsheet_dashboard_oca/static/src/bundle/share_manage/share_manage_dialog.xml:0
msgid "Share link"
msgstr ""

#. module: spreadsheet_dashboard_oca
#: model:ir.model.fields,field_description:spreadsheet_dashboard_oca.field_spreadsheet_to_dashboard__spreadsheet_id
msgid "Spreadsheet"
Expand Down
1 change: 1 addition & 0 deletions spreadsheet_dashboard_oca/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import spreadsheet_dashboard
from . import spreadsheet_dashboard_share
39 changes: 39 additions & 0 deletions spreadsheet_dashboard_oca/models/spreadsheet_dashboard_share.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2026 Volkan Tasci
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


class SpreadsheetDashboardShare(models.Model):
_inherit = "spreadsheet.dashboard.share"

@api.model
def action_get_dashboard_shares(self, dashboard_id):
"""Return the shares of a dashboard the current user can see."""
shares = self.search([("dashboard_id", "=", dashboard_id)])
return [
{
"id": share.id,
"full_url": share.full_url,
"create_date": (
share.create_date.isoformat() if share.create_date else False
),
"create_uid": (
share.create_uid.display_name if share.create_uid else False
),
"name": share.name,
}
for share in shares
]

@api.model
def action_unshare(self, share_ids):
"""Revoke shares. ir.rule limits the user to the shares they may access."""
self.browse(share_ids).unlink()
return True

@api.model
def action_get_share_counts(self):
"""Return {dashboard_id: share_count} for shares visible to the user."""
counts = self._read_group([], ["dashboard_id"], ["__count"])
return {count[0].id: count[1] for count in counts if count[0]}
3 changes: 3 additions & 0 deletions spreadsheet_dashboard_oca/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Users can only see and revoke the shares they created. Users in the
"Dashboards / Admin" group (spreadsheet_dashboard.group_dashboard_manager)
can see and revoke the shares created by any user.
4 changes: 3 additions & 1 deletion spreadsheet_dashboard_oca/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
This module allows to edit spreadsheet dashboards using OCA Spreadsheet
editor.
editor. It also allows to manage the public share links of those
dashboards: list, copy, and revoke them. Dashboard admins can manage the
shares created by any user.
7 changes: 7 additions & 0 deletions spreadsheet_dashboard_oca/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Open the "Dashboards" app (Rapor Panelleri).
- Open a dashboard and click on the **Share** button.
- Click on **Manage shares** to list every share link of the dashboard.
- Use the copy button to copy a link, or click **Revoke** to make a link
return a 404 error.
- A badge next to the dashboard name in the sidebar shows the number of
active shares.
12 changes: 12 additions & 0 deletions spreadsheet_dashboard_oca/security/ir_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="spreadsheet_dashboard_share_manager_rule" model="ir.rule">
<field name="name">spreadsheet.dashboard.share: manager sees all</field>
<field name="model_id" ref="model_spreadsheet_dashboard_share" />
<field
name="groups"
eval="[(4, ref('spreadsheet_dashboard.group_dashboard_manager'))]"
/>
<field name="domain_force">[(1, '=', 1)]</field>
</record>
</odoo>
47 changes: 35 additions & 12 deletions spreadsheet_dashboard_oca/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Spreadsheet Dashboard Oca</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -376,37 +376,60 @@ <h1>Spreadsheet Dashboard Oca</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/spreadsheet/tree/19.0/spreadsheet_dashboard_oca"><img alt="OCA/spreadsheet" src="https://img.shields.io/badge/github-OCA%2Fspreadsheet-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/spreadsheet-19-0/spreadsheet-19-0-spreadsheet_dashboard_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/spreadsheet&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to edit spreadsheet dashboards using OCA Spreadsheet
editor.</p>
editor. It also allows to manage the public share links of those
dashboards: list, copy, and revoke them. Dashboard admins can manage the
shares created by any user.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
<p>Users can only see and revoke the shares they created. Users in the
“Dashboards / Admin” group
(spreadsheet_dashboard.group_dashboard_manager) can see and revoke the
shares created by any user.</p>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
<ul class="simple">
<li>Open the “Dashboards” app (Rapor Panelleri).</li>
<li>Open a dashboard and click on the <strong>Share</strong> button.</li>
<li>Click on <strong>Manage shares</strong> to list every share link of the dashboard.</li>
<li>Use the copy button to copy a link, or click <strong>Revoke</strong> to make a link
return a 404 error.</li>
<li>A badge next to the dashboard name in the sidebar shows the number of
active shares.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/spreadsheet/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/spreadsheet/issues/new?body=module:%20spreadsheet_dashboard_oca%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
<ul class="simple">
<li>CreuBlanca</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
<h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
<ul class="simple">
<li>Enric Tobella</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
Expand All @@ -420,7 +443,7 @@ <h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
Loading
Loading