From 279891c8f484409cd318065db639ec00392f21de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 23 Feb 2021 09:37:51 +0100 Subject: [PATCH] [FIX] document_page_approval: Add correct followers in history pages [BOT] post-merge updates --- document_page_approval/README.rst | 8 +++-- document_page_approval/__manifest__.py | 2 +- .../models/document_page_history.py | 2 +- .../readme/CONTRIBUTORS.rst | 6 +++- .../static/description/index.html | 30 +++++++++++++------ .../tests/test_document_page_approval.py | 15 ++++++++++ 6 files changed, 49 insertions(+), 14 deletions(-) diff --git a/document_page_approval/README.rst b/document_page_approval/README.rst index 3485738d..64f67ea1 100644 --- a/document_page_approval/README.rst +++ b/document_page_approval/README.rst @@ -7,7 +7,7 @@ Document Page Approval !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ca1d6c5564a2a481b7722e98d0be8dd36b075b71592b62c54b782c6d584d3319 + !! source digest: sha256:eaa85b29d79372636ce9dda9fbf87f567e6702f38a57385384a168b28a517ff5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -84,7 +84,11 @@ Contributors * Gervais Naoussi * Maxime Chambreuil * Iván Todorovich -* Victor M.M. Torres + +* `Tecnativa `_: + + * Victor M.M. Torres + * Víctor Martínez * `Guadaltech `_: diff --git a/document_page_approval/__manifest__.py b/document_page_approval/__manifest__.py index 81c3eaea..648f4c64 100644 --- a/document_page_approval/__manifest__.py +++ b/document_page_approval/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Document Page Approval", - "version": "16.0.1.1.0", + "version": "16.0.1.1.1", "author": "Savoir-faire Linux, Odoo Community Association (OCA)", "website": "https://github.com/OCA/knowledge", "license": "AGPL-3", diff --git a/document_page_approval/models/document_page_history.py b/document_page_approval/models/document_page_history.py index 7502047e..905e6f0b 100644 --- a/document_page_approval/models/document_page_history.py +++ b/document_page_approval/models/document_page_history.py @@ -78,7 +78,7 @@ class DocumentPageHistory(models.Model): users = self.env["res.users"].search( [("groups_id", "in", guids), ("groups_id", "in", approver_gid.id)] ) - rec.message_subscribe([u.id for u in users]) + rec.message_subscribe(partner_ids=users.mapped("partner_id").ids) rec.message_post_with_template(template.id) else: # auto-approve if approval is not required diff --git a/document_page_approval/readme/CONTRIBUTORS.rst b/document_page_approval/readme/CONTRIBUTORS.rst index f2a999f9..a06acbda 100644 --- a/document_page_approval/readme/CONTRIBUTORS.rst +++ b/document_page_approval/readme/CONTRIBUTORS.rst @@ -3,7 +3,11 @@ * Gervais Naoussi * Maxime Chambreuil * Iván Todorovich -* Victor M.M. Torres + +* `Tecnativa `_: + + * Victor M.M. Torres + * Víctor Martínez * `Guadaltech `_: diff --git a/document_page_approval/static/description/index.html b/document_page_approval/static/description/index.html index 5b303219..4476c368 100644 --- a/document_page_approval/static/description/index.html +++ b/document_page_approval/static/description/index.html @@ -1,4 +1,3 @@ - @@ -367,7 +366,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:ca1d6c5564a2a481b7722e98d0be8dd36b075b71592b62c54b782c6d584d3319 +!! source digest: sha256:eaa85b29d79372636ce9dda9fbf87f567e6702f38a57385384a168b28a517ff5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module adds a workflow to approve page modifications @@ -426,14 +425,27 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Contributors

+
    +
  • Odoo SA <info@odoo.com>

    +
  • +
  • Savoir-faire Linux <support@savoirfairelinux.com>

    +
  • +
  • Gervais Naoussi <gervaisnaoussi@gmail.com>

    +
  • +
  • Maxime Chambreuil <mchambreuil@opensourceintegrators.com>

    +
  • +
  • Iván Todorovich <ivan.todorovich@gmail.com>

    +
  • +
  • Tecnativa:

    +
    +
      +
    • Victor M.M. Torres
    • +
    • Víctor Martínez
    • +
    +
    +
  • +
  • Guadaltech:

      -
    • Odoo SA <info@odoo.com>
    • -
    • Savoir-faire Linux <support@savoirfairelinux.com>
    • -
    • Gervais Naoussi <gervaisnaoussi@gmail.com>
    • -
    • Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
    • -
    • Iván Todorovich <ivan.todorovich@gmail.com>
    • -
    • Victor M.M. Torres <victor.martin@tecnativa.com>
    • -
    • Guadaltech:
    • diff --git a/document_page_approval/tests/test_document_page_approval.py b/document_page_approval/tests/test_document_page_approval.py index ac0f3c62..e9154ade 100644 --- a/document_page_approval/tests/test_document_page_approval.py +++ b/document_page_approval/tests/test_document_page_approval.py @@ -13,6 +13,18 @@ class TestDocumentPageApproval(common.TransactionCase): "document_page_approval.group_document_approver_user" ) self.env.ref("base.user_root").write({"groups_id": [(4, self.approver_gid.id)]}) + self.env.ref("base.user_admin").write( + {"groups_id": [(4, self.approver_gid.id)]} + ) + self.user2 = self.env["res.users"].create( + { + "name": "Test user 2", + "login": "Test user 2", + "groups_id": [ + (6, 0, [self.env.ref("base.group_user").id, self.approver_gid.id]) + ], + } + ) # demo_approval self.category2 = self.page_obj.create( { @@ -44,6 +56,9 @@ class TestDocumentPageApproval(common.TransactionCase): # It should automatically be in 'to approve' state self.assertEqual(chreq.state, "to approve") + user_admin = self.env.ref("base.user_admin") + self.assertTrue(user_admin.partner_id.id in chreq.message_partner_ids.ids) + self.assertTrue(self.user2.partner_id.id in chreq.message_partner_ids.ids) # Needed to compute calculated fields page.invalidate_model()