diff --git a/.copier-answers.yml b/.copier-answers.yml index 7925718ed..f3fb39480 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.33 +_commit: v1.37 _src_path: git+https://github.com/OCA/oca-addons-repo-template additional_ruff_rules: [] ci: GitHub diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..e0d56685a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +test-requirements.txt merge=union diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5eb021ef1..852a07469 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,6 +17,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" + cache: 'pip' - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67344f582..c1354aa96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,7 @@ jobs: makepot: "true" services: postgres: - image: postgres:12.0 + image: postgres:12 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo @@ -76,6 +76,13 @@ jobs: run: oca_init_test_database - name: Run tests run: oca_run_tests + - name: Upload screenshots from JS tests + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }} + path: /tmp/odoo_tests/${{ env.PGDATABASE }} + if-no-files-found: ignore - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e08af4c1..2e2a990ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,11 +39,11 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/sbidoul/whool - rev: v1.2 + rev: v1.3 hooks: - id: whool-init - repo: https://github.com/oca/maintainer-tools - rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded + rev: b89f767503be6ab2b11e4f50a7557cb20066e667 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons diff --git a/.pylintrc b/.pylintrc index 7c62b6d2e..197cb6737 100644 --- a/.pylintrc +++ b/.pylintrc @@ -25,19 +25,25 @@ disable=all enable=anomalous-backslash-in-string, api-one-deprecated, api-one-multi-together, - assignment-from-none, - attribute-deprecated, class-camelcase, - dangerous-default-value, dangerous-view-replace-wo-priority, - development-status-allowed, duplicate-id-csv, - duplicate-key, duplicate-xml-fields, duplicate-xml-record-id, eval-referenced, - eval-used, incoherent-interpreter-exec-perm, + openerp-exception-warning, + redundant-modulename-xml, + relative-import, + rst-syntax-error, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + assignment-from-none, + attribute-deprecated, + dangerous-default-value, + development-status-allowed, + duplicate-key, + eval-used, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -48,73 +54,68 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, - attribute-string-redundant, character-not-valid-in-resource-link, - consider-merging-classes-inherited, - context-overridden, create-user-wo-reset-password, dangerous-filter-wo-user, dangerous-qweb-replace-wo-priority, deprecated-data-xml-node, deprecated-openerp-xml-node, duplicate-po-message-definition, - except-pass, file-not-used, + missing-newline-extrafiles, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + str-format-used, + unnecessary-utf8-coding-comment, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + attribute-string-redundant, + consider-merging-classes-inherited, + context-overridden, + except-pass, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout, - # messages that do not cause the lint step to fail - consider-merging-classes-inherited, + missing-manifest-dependency, + too-complex,, create-user-wo-reset-password, dangerous-filter-wo-user, - deprecated-module, file-not-used, - invalid-commit, - missing-manifest-dependency, missing-newline-extrafiles, - missing-readme, no-utf8-coding-comment, - odoo-addons-relative-import, old-api7-method-defined, + unnecessary-utf8-coding-comment, + # messages that do not cause the lint step to fail + consider-merging-classes-inherited, + deprecated-module, + invalid-commit, + missing-readme, + odoo-addons-relative-import, redefined-builtin, - too-complex, - unnecessary-utf8-coding-comment + manifest-external-assets [REPORTS] diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 018fd61cd..73674c04d 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -17,19 +17,25 @@ disable=all enable=anomalous-backslash-in-string, api-one-deprecated, api-one-multi-together, - assignment-from-none, - attribute-deprecated, class-camelcase, - dangerous-default-value, dangerous-view-replace-wo-priority, - development-status-allowed, duplicate-id-csv, - duplicate-key, duplicate-xml-fields, duplicate-xml-record-id, eval-referenced, - eval-used, incoherent-interpreter-exec-perm, + openerp-exception-warning, + redundant-modulename-xml, + relative-import, + rst-syntax-error, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + assignment-from-none, + attribute-deprecated, + dangerous-default-value, + development-status-allowed, + duplicate-key, + eval-used, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -40,56 +46,50 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, - attribute-string-redundant, character-not-valid-in-resource-link, - consider-merging-classes-inherited, - context-overridden, create-user-wo-reset-password, dangerous-filter-wo-user, dangerous-qweb-replace-wo-priority, deprecated-data-xml-node, deprecated-openerp-xml-node, duplicate-po-message-definition, - except-pass, file-not-used, + missing-newline-extrafiles, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + str-format-used, + unnecessary-utf8-coding-comment, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + attribute-string-redundant, + consider-merging-classes-inherited, + context-overridden, + except-pass, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout [REPORTS] diff --git a/README.md b/README.md index dab49bc58..52228a49b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ +[![Support the OCA](https://odoo-community.org/readme-banner-image)](https://odoo-community.org/get-involved?utm_source=repo-readme) +# mail [![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0) [![Pre-commit Status](https://github.com/OCA/mail/actions/workflows/pre-commit.yml/badge.svg?branch=18.0)](https://github.com/OCA/mail/actions/workflows/pre-commit.yml?query=branch%3A18.0) [![Build Status](https://github.com/OCA/mail/actions/workflows/test.yml/badge.svg?branch=18.0)](https://github.com/OCA/mail/actions/workflows/test.yml?query=branch%3A18.0) @@ -7,8 +9,6 @@ -# mail - mail @@ -26,7 +26,7 @@ addon | version | maintainers | summary [mail_activity_dashboard](mail_activity_dashboard/) | 18.0.1.0.0 | | Add Activity Dashboards [mail_activity_done](mail_activity_done/) | 18.0.1.0.0 | | Mail Activity Done [mail_activity_reminder](mail_activity_reminder/) | 18.0.1.0.0 | | Reminder notifications about planned activities -[mail_activity_team](mail_activity_team/) | 18.0.1.0.2 | | Add Teams to Activities +[mail_activity_team](mail_activity_team/) | 18.0.1.0.3 | | Add Teams to Activities [mail_attach_existing_attachment](mail_attach_existing_attachment/) | 18.0.1.0.0 | | Adding attachment on the object by sending this one [mail_attach_existing_attachment_account](mail_attach_existing_attachment_account/) | 18.0.1.0.0 | | Module to use attach existing attachment for account module [mail_autogenerated_header](mail_autogenerated_header/) | 18.0.1.1.0 | | Add headers to Odoo's mails indicating they are autogenerated diff --git a/checklog-odoo.cfg b/checklog-odoo.cfg index 0b55b7bf6..9cc94b30d 100644 --- a/checklog-odoo.cfg +++ b/checklog-odoo.cfg @@ -1,3 +1,4 @@ [checklog-odoo] ignore= WARNING.* 0 failed, 0 error\(s\).* + WARNING.* Missing widget: res_partner_many2one for field of type many2one.* diff --git a/mail_activity_team/README.rst b/mail_activity_team/README.rst index 96a8adda7..25f65e0a5 100644 --- a/mail_activity_team/README.rst +++ b/mail_activity_team/README.rst @@ -11,7 +11,7 @@ Mail Activity Team !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:4ddbbf29e9941ec7189251a2a0c0219aa7dbf652e67e7684b632cebbeb498393 + !! source digest: sha256:ca0203ad2f0fed4e4686b319424332ac44446e2380683a802c1052f78584cfa4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/mail_activity_team/__init__.py b/mail_activity_team/__init__.py index c19ab79ba..9b4296142 100644 --- a/mail_activity_team/__init__.py +++ b/mail_activity_team/__init__.py @@ -1,3 +1,2 @@ -from .hooks import post_load_hook from . import models from . import wizard diff --git a/mail_activity_team/__manifest__.py b/mail_activity_team/__manifest__.py index 4dd330eb2..f03997720 100644 --- a/mail_activity_team/__manifest__.py +++ b/mail_activity_team/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Mail Activity Team", "summary": "Add Teams to Activities", - "version": "18.0.1.0.2", + "version": "18.0.1.0.3", "development_status": "Beta", "category": "Social Network", "website": "https://github.com/OCA/mail", @@ -30,5 +30,4 @@ "mail_activity_team/static/src/models/*", ], }, - "post_load": "post_load_hook", } diff --git a/mail_activity_team/hooks.py b/mail_activity_team/hooks.py deleted file mode 100644 index 4611d85f0..000000000 --- a/mail_activity_team/hooks.py +++ /dev/null @@ -1,13 +0,0 @@ -import logging - -from odoo.addons.mail.models.mail_activity import MailActivity - -from .patch import mail_activity__create - -_logger = logging.getLogger(__name__) - - -def post_load_hook(): - """See patch.py for more info""" - MailActivity.create = mail_activity__create - _logger.info("PATCHED mail's mail.activity create") diff --git a/mail_activity_team/patch.py b/mail_activity_team/patch.py deleted file mode 100644 index e6ae6cfda..000000000 --- a/mail_activity_team/patch.py +++ /dev/null @@ -1,65 +0,0 @@ -from odoo import api, fields - -from odoo.addons.mail.models.mail_activity import MailActivity - - -@api.model_create_multi -def mail_activity__create(self, vals_list): - # Monkeypatch for mail's mail.activity's create method to prevent - # UnboundLocalError: cannot access local variable 'activity' - # where it is not associated with a value - # which occurs when this module creates activities without a user_id. - # Patch below is according to https://github.com/odoo/odoo/pull/197864 - activities = super(MailActivity, self).create(vals_list) - - # find partners related to responsible users, separate readable from unreadable - if any(user != self.env.user for user in activities.user_id): - user_partners = activities.user_id.partner_id - readable_user_partners = user_partners._filtered_access("read") - else: - readable_user_partners = self.env.user.partner_id - - # when creating activities for other: send a notification to assigned user; - if self.env.context.get("mail_activity_quick_update"): - activities_to_notify = self.env["mail.activity"] - else: - activities_to_notify = activities.filtered( - lambda act: act.user_id != self.env.user - ) - if activities_to_notify: - to_sudo = activities_to_notify.filtered( - lambda act: act.user_id.partner_id not in readable_user_partners - ) - other = activities_to_notify - to_sudo - to_sudo.sudo().action_notify() - other.action_notify() - - # subscribe (batch by model and user to speedup) - for model, activity_data in activities._classify_by_model().items(): - per_user = dict() - for activity in activity_data["activities"].filtered(lambda act: act.user_id): - if activity.user_id not in per_user: - per_user[activity.user_id] = [activity.res_id] - else: - per_user[activity.user_id].append(activity.res_id) - for user, res_ids in per_user.items(): - pids = ( - user.partner_id.ids - if user.partner_id in readable_user_partners - else user.sudo().partner_id.ids - ) - self.env[model].browse(res_ids).message_subscribe(partner_ids=pids) - - # send notifications about activity creation - todo_activities = activities.filtered( - lambda act: act.date_deadline <= fields.Date.today() - ) - if todo_activities: - # Monkeypatch start - # activity.user_id._bus_send("mail.activity/updated", - # {"activity_created": True}) - todo_activities.user_id._bus_send( - "mail.activity/updated", {"activity_created": True} - ) - # Monkeypatch end - return activities diff --git a/mail_activity_team/static/description/index.html b/mail_activity_team/static/description/index.html index a35f00d28..f00a68aeb 100644 --- a/mail_activity_team/static/description/index.html +++ b/mail_activity_team/static/description/index.html @@ -372,7 +372,7 @@

Mail Activity Team

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:4ddbbf29e9941ec7189251a2a0c0219aa7dbf652e67e7684b632cebbeb498393 +!! source digest: sha256:ca0203ad2f0fed4e4686b319424332ac44446e2380683a802c1052f78584cfa4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module adds the possibility to assign teams to activities.