From f4148e5068def3bc6c7bd482197d8aa576496f26 Mon Sep 17 00:00:00 2001 From: Juanjo Date: Mon, 2 Sep 2024 17:01:36 +0200 Subject: [PATCH] [MIG] hr_announcement: Migration to 17.0 --- hr_announcement/README.rst | 1 + hr_announcement/__manifest__.py | 2 +- hr_announcement/models/announcement.py | 4 ++-- hr_announcement/readme/CONTRIBUTORS.md | 1 + hr_announcement/static/description/index.html | 1 + hr_announcement/views/announcement_views.xml | 9 ++++++--- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hr_announcement/README.rst b/hr_announcement/README.rst index 9ba93fe56e0..935cae3bc9a 100644 --- a/hr_announcement/README.rst +++ b/hr_announcement/README.rst @@ -81,6 +81,7 @@ Contributors - `Tecnativa `__: - Pilar Vargas + - Juan José Seguí Maintainers ----------- diff --git a/hr_announcement/__manifest__.py b/hr_announcement/__manifest__.py index ee530ee69e8..3fc97e0c28d 100644 --- a/hr_announcement/__manifest__.py +++ b/hr_announcement/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Announcement", - "version": "15.0.1.0.0", + "version": "17.0.1.0.0", "summary": "", "author": "Tecnativa, Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/hr_announcement/models/announcement.py b/hr_announcement/models/announcement.py index 1a8c7a3cf19..57e3362a667 100644 --- a/hr_announcement/models/announcement.py +++ b/hr_announcement/models/announcement.py @@ -36,8 +36,8 @@ def _update_read_unread_announcements(self): itself""" for announcement in self: for employee in announcement.employee_ids.filtered( - lambda x: x.user_id - and announcement + lambda x, ann=announcement: x.user_id + and ann not in ( x.user_id.read_announcement_ids + x.user_id.unread_announcement_ids ) diff --git a/hr_announcement/readme/CONTRIBUTORS.md b/hr_announcement/readme/CONTRIBUTORS.md index df940da7c62..150b2772da8 100644 --- a/hr_announcement/readme/CONTRIBUTORS.md +++ b/hr_announcement/readme/CONTRIBUTORS.md @@ -1,2 +1,3 @@ - [Tecnativa](https://www.tecnativa.com): - Pilar Vargas + - Juan José Seguí diff --git a/hr_announcement/static/description/index.html b/hr_announcement/static/description/index.html index 8c69798cd30..82748633217 100644 --- a/hr_announcement/static/description/index.html +++ b/hr_announcement/static/description/index.html @@ -422,6 +422,7 @@

Contributors

diff --git a/hr_announcement/views/announcement_views.xml b/hr_announcement/views/announcement_views.xml index fc464383757..851c0f8b63a 100644 --- a/hr_announcement/views/announcement_views.xml +++ b/hr_announcement/views/announcement_views.xml @@ -9,19 +9,22 @@ name="employee_ids" options="{'no_create': True}" widget="many2many_tags" - attrs="{'invisible': [('announcement_type', '!=', 'employee')], 'required': [('announcement_type', '=', 'employee')]}" + invisible="announcement_type != 'employee'" + required="announcement_type == 'employee'" />