From c7ea3892f31c2ea68a8a297ed3aa407d1b58304d Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Fri, 21 Nov 2025 01:22:04 +0100 Subject: [PATCH 1/3] [IMP] spreadsheet_oca: * Add Kanban views * Also add active option [IMP] spreadsheet_oca: * Simplify partner usage * Add tags * Improve kanban view [IMP] spreadsheet_oca: Improve form view [IMP] spreadhseet_oca: add tag menu [IMP] spreadhseet_oca: add default image IMP: Add tag on view [REF] spreadsheet_oca: no more partner [REF] spreadsheet_oca: no more partner [REF] spreadsheet_oca: no more partner [REF]rename file [ACL]Ad specific rule for manager --- spreadsheet_oca/README.rst | 10 +- spreadsheet_oca/models/__init__.py | 1 + .../models/spreadsheet_abstract.py | 1 + .../models/spreadsheet_spreadsheet.py | 7 +- .../models/spreadsheet_spreadsheet_tag.py | 24 +++ spreadsheet_oca/readme/CONTRIBUTORS.md | 4 +- spreadsheet_oca/security/ir.model.access.csv | 2 + spreadsheet_oca/static/description/index.html | 45 +++--- .../views/spreadsheet_spreadsheet.xml | 150 +++++++++++++++++- 9 files changed, 205 insertions(+), 39 deletions(-) create mode 100644 spreadsheet_oca/models/spreadsheet_spreadsheet_tag.py diff --git a/spreadsheet_oca/README.rst b/spreadsheet_oca/README.rst index b1adfc68..e62262cc 100644 --- a/spreadsheet_oca/README.rst +++ b/spreadsheet_oca/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - =============== Spreadsheet Oca =============== @@ -17,7 +13,7 @@ Spreadsheet Oca .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fspreadsheet-lightgray.png?logo=github @@ -129,6 +125,10 @@ Contributors - Chris Mann +- `Mind And Go `__ + + - Florent THOMAS + Maintainers ----------- diff --git a/spreadsheet_oca/models/__init__.py b/spreadsheet_oca/models/__init__.py index 60d31886..c5ec2360 100644 --- a/spreadsheet_oca/models/__init__.py +++ b/spreadsheet_oca/models/__init__.py @@ -1,4 +1,5 @@ from . import spreadsheet_abstract +from . import spreadsheet_spreadsheet_tag from . import spreadsheet_spreadsheet from . import spreadsheet_oca_revision from . import ir_websocket diff --git a/spreadsheet_oca/models/spreadsheet_abstract.py b/spreadsheet_oca/models/spreadsheet_abstract.py index c43be6bb..86a1e317 100644 --- a/spreadsheet_oca/models/spreadsheet_abstract.py +++ b/spreadsheet_oca/models/spreadsheet_abstract.py @@ -17,6 +17,7 @@ class SpreadsheetAbstract(models.AbstractModel): _inherit = ["bus.listener.mixin"] name = fields.Char(required=True) + active = fields.Boolean(default=True) spreadsheet_binary_data = fields.Binary( string="Spreadsheet file", default=lambda self: self._empty_spreadsheet_data_base64(), diff --git a/spreadsheet_oca/models/spreadsheet_spreadsheet.py b/spreadsheet_oca/models/spreadsheet_spreadsheet.py index 86263f8d..55a9ae9f 100644 --- a/spreadsheet_oca/models/spreadsheet_spreadsheet.py +++ b/spreadsheet_oca/models/spreadsheet_spreadsheet.py @@ -10,10 +10,11 @@ class SpreadsheetSpreadsheet(models.Model): _name = "spreadsheet.spreadsheet" - _inherit = "spreadsheet.abstract" + _inherit = ["spreadsheet.abstract", "mail.thread", "mail.activity.mixin"] _description = "Spreadsheet" filename = fields.Char(compute="_compute_filename") + badge_image = fields.Image("Badge Background", max_width=1024, max_height=1024) owner_id = fields.Many2one( "res.users", required=True, default=lambda r: r.env.user.id ) @@ -51,6 +52,10 @@ class SpreadsheetSpreadsheet(models.Model): " if this company is in the current companies.", ) + spreadsheet_tag_ids = fields.Many2many( + string="Tags", comodel_name="spreadsheet.spreadsheet.tag" + ) + @api.depends("name") def _compute_filename(self): for record in self: diff --git a/spreadsheet_oca/models/spreadsheet_spreadsheet_tag.py b/spreadsheet_oca/models/spreadsheet_spreadsheet_tag.py new file mode 100644 index 00000000..29fc9593 --- /dev/null +++ b/spreadsheet_oca/models/spreadsheet_spreadsheet_tag.py @@ -0,0 +1,24 @@ +# Copyright 2022 CreuBlanca +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from random import randint + +from odoo import fields, models + + +class SpreadsheetSpreadsheetTags(models.Model): + _name = "spreadsheet.spreadsheet.tag" + _description = "Spreadsheet Tag" + + def _get_default_color(self): + return randint(1, 11) + + name = fields.Char(required=True, translate=True) + color = fields.Integer( + default=_get_default_color, + help="Transparent tags are not visible in the kanban view", + ) + + _sql_constraints = [ + ("name_uniq", "unique (name)", "A tag with the same name already exists."), + ] diff --git a/spreadsheet_oca/readme/CONTRIBUTORS.md b/spreadsheet_oca/readme/CONTRIBUTORS.md index b262cef9..e5a41e3d 100644 --- a/spreadsheet_oca/readme/CONTRIBUTORS.md +++ b/spreadsheet_oca/readme/CONTRIBUTORS.md @@ -2,4 +2,6 @@ - [Tecnativa](https://www.tecnativa.com): - Carlos Roca - [Open User Systems](https://www.openusersystems.com): - - Chris Mann \ No newline at end of file + - Chris Mann +- [Mind And Go](https://mind-and-go.com) + - Florent THOMAS \ No newline at end of file diff --git a/spreadsheet_oca/security/ir.model.access.csv b/spreadsheet_oca/security/ir.model.access.csv index f25d2e12..9d6b9d8b 100644 --- a/spreadsheet_oca/security/ir.model.access.csv +++ b/spreadsheet_oca/security/ir.model.access.csv @@ -4,3 +4,5 @@ access_spreadsheet_oca_revision,access_spreadsheet_oca_revision,model_spreadshee spreadsheet_oca.access_spreadsheet_spreadsheet_import,access_spreadsheet_spreadsheet_import,spreadsheet_oca.model_spreadsheet_spreadsheet_import,base.group_user,1,1,1,1 access_spreadsheet_import_mode,access_spreadsheet_oca_revision,model_spreadsheet_spreadsheet_import_mode,base.group_user,1,0,0,0 access_spreadsheet_select_row_number,access_spreadsheet_select_row_number,model_spreadsheet_select_row_number,base.group_user,1,1,1,1 +access_spreadsheet_spreadsheet_tag,access_spreadsheet_spreadsheet_tag,model_spreadsheet_spreadsheet_tag,spreadsheet_oca.group_user,1,0,1,0 +access_spreadsheet_spreadsheet_manager_tag,access_spreadsheet_spreadsheet_manager_tag,model_spreadsheet_spreadsheet_tag,spreadsheet_oca.group_manager,1,1,1,1 diff --git a/spreadsheet_oca/static/description/index.html b/spreadsheet_oca/static/description/index.html index 1245a2f4..8882acac 100644 --- a/spreadsheet_oca/static/description/index.html +++ b/spreadsheet_oca/static/description/index.html @@ -3,16 +3,15 @@ -README.rst +Spreadsheet Oca -
+
+

Spreadsheet Oca

- - -Odoo Community Association - -
-

Spreadsheet Oca

-

Beta License: AGPL-3 OCA/spreadsheet Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/spreadsheet Translate me on Weblate Try me on Runboat

This module adds a functionality for adding and editing Spreadsheets using Odoo CE.

It is an alternative to the proprietary module spreadsheet_edition @@ -397,9 +391,9 @@

Spreadsheet Oca

-

Usage

+

Usage

-

Create a new spreadsheet

+

Create a new spreadsheet

-

Development

+

Development

If you want to develop custom business functions, you can add others, based on the file https://github.com/odoo/odoo/blob/16.0/addons/spreadsheet_account/static/src/accounting_functions.js

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. 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 @@ -461,15 +455,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • CreuBlanca
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

- -Odoo Community Association - +Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

@@ -496,6 +492,5 @@

Maintainers

-
diff --git a/spreadsheet_oca/views/spreadsheet_spreadsheet.xml b/spreadsheet_oca/views/spreadsheet_spreadsheet.xml index 66dc4882..60d1ea15 100644 --- a/spreadsheet_oca/views/spreadsheet_spreadsheet.xml +++ b/spreadsheet_oca/views/spreadsheet_spreadsheet.xml @@ -6,7 +6,26 @@ spreadsheet.spreadsheet.search (in spreadsheet_oca) spreadsheet.spreadsheet - + + + + + + + + + + + + @@ -42,17 +61,30 @@ icon="fa-pencil" /> -

- -

+ +
+

+
+ +
+

+
+ - + + + + + + spreadsheet.spreadsheet.kanban + spreadsheet.spreadsheet + + + + + Edit + Delete + + + + +
+
+ + + +
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ + + Spreadsheets Tags + spreadsheet.spreadsheet.tag + list,form + [] + {} + + Spreadsheets spreadsheet.spreadsheet - list,form + kanban,list,form [] - {} + {'search_default_mysheets': 1} @@ -93,4 +214,19 @@ + + + Configuration + + + + + + + Spreadsheets Tags + + + + + From 139d165f514f1af44320ade3a8d2c3a2b18926fe Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Fri, 12 Dec 2025 09:40:39 +0100 Subject: [PATCH 2/3] [IMP]Active ribbon and chatter on view --- spreadsheet_oca/views/spreadsheet_spreadsheet.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spreadsheet_oca/views/spreadsheet_spreadsheet.xml b/spreadsheet_oca/views/spreadsheet_spreadsheet.xml index 60d1ea15..b2684e67 100644 --- a/spreadsheet_oca/views/spreadsheet_spreadsheet.xml +++ b/spreadsheet_oca/views/spreadsheet_spreadsheet.xml @@ -53,6 +53,13 @@
+ +