From ac23d1b648d868a575bd706e191180e6b5dd2ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Fri, 17 Mar 2023 18:51:45 +0100 Subject: [PATCH] tracking_manager: fix access right issue if sudo have been used --- tracking_manager/README.rst | 15 ++++--- tracking_manager/__manifest__.py | 2 +- tracking_manager/models/models.py | 3 +- .../static/description/index.html | 40 ++++++++++--------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/tracking_manager/README.rst b/tracking_manager/README.rst index e5758e8a6..4d1b267a5 100644 --- a/tracking_manager/README.rst +++ b/tracking_manager/README.rst @@ -2,10 +2,13 @@ Tracking Manager ================ -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:6c896338ee53318978abf97b77d0ed909ea385ea96003de5630c67ecc459521b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Tracking Manager .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-tracking_manager :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/149/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=14.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows to track all fields on every model that has a chatter, including one2many and many2many ones. This excludes the computed, readonly, related fields by default. In addition, line changes of a one2many field can be tracked (e.g. product_uom_qty of an order_line in a sale order). @@ -56,7 +59,7 @@ 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 smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/tracking_manager/__manifest__.py b/tracking_manager/__manifest__.py index f9e392540..af21ccdc0 100644 --- a/tracking_manager/__manifest__.py +++ b/tracking_manager/__manifest__.py @@ -6,7 +6,7 @@ "name": "Tracking Manager", "summary": """This module tracks all fields of a model, including one2many and many2many ones.""", - "version": "14.0.1.0.1", + "version": "14.0.1.0.2", "category": "Tools", "website": "https://github.com/OCA/server-tools", "author": "Akretion, Odoo Community Association (OCA)", diff --git a/tracking_manager/models/models.py b/tracking_manager/models/models.py index 9d99cb70d..a6ecbd779 100644 --- a/tracking_manager/models/models.py +++ b/tracking_manager/models/models.py @@ -120,7 +120,8 @@ class Base(models.AbstractModel): f"tracking.manager.before.{self._name}", {} ) for _id, values in initial_values.items(): - record = self.browse(_id) + # Always use sudo in case that the record have been modified using sudo + record = self.sudo().browse(_id) if not record.exists(): # if a record have been modify and then deleted # it's not need to track the change so skip it diff --git a/tracking_manager/static/description/index.html b/tracking_manager/static/description/index.html index c45ec7d0a..cc9506e5d 100644 --- a/tracking_manager/static/description/index.html +++ b/tracking_manager/static/description/index.html @@ -1,20 +1,20 @@ - + - + Tracking Manager