Skip to content

Conversation

@TheSumitBasak
Copy link

Migration mail_activity_unlink_log to 19.0

Copilot AI review requested due to automatic review settings December 26, 2025 09:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the mail_activity_unlink_log module from a previous version to Odoo 19.0. The module enforces the creation of a message when an activity is unlinked, preventing the deletion of activities without notification.

  • Migration of module version to 19.0.1.0.0
  • Addition of test suite for validating activity unlinking behavior
  • Inclusion of translation files, documentation, and module metadata

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
mail_activity_unlink_log/manifest.py Updated module manifest with version 19.0.1.0.0 and module metadata
mail_activity_unlink_log/init.py Module initialization importing models
mail_activity_unlink_log/models/init.py Models package initialization
mail_activity_unlink_log/models/mail_activity.py Core functionality: overrides unlink methods to log activity deletions
mail_activity_unlink_log/tests/init.py Test package initialization
mail_activity_unlink_log/tests/test_activity_unlink.py Test cases for activity done and unlink scenarios
mail_activity_unlink_log/data/unlink_message.xml Data file defining message subtype and template for unlink notifications
mail_activity_unlink_log/i18n/mail_activity_unlink_log.pot Translation template file
mail_activity_unlink_log/i18n/it.po Italian translations
mail_activity_unlink_log/i18n/es.po Spanish translations
mail_activity_unlink_log/readme/DESCRIPTION.md Module description for README generation
mail_activity_unlink_log/readme/CONTRIBUTORS.md Contributors list for README generation
mail_activity_unlink_log/README.rst Generated module documentation
mail_activity_unlink_log/static/description/index.html HTML documentation for module
mail_activity_unlink_log/static/description/icon.png Module icon (binary file)
mail_activity_unlink_log/pyproject.toml Build configuration using whool

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Project-Id-Version header still references "Odoo Server 18.0" but this is a migration to 19.0. This should be updated to "Odoo Server 19.0" to match the module version in manifest.py.

Suggested change
"Project-Id-Version: Odoo Server 18.0\n"
"Project-Id-Version: Odoo Server 19.0\n"

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +27
subtype_id=self.env["ir.model.data"]._xmlid_to_res_id(
"mail_activity_unlink_log.mt_activities_unlink"
),
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method _xmlid_to_res_id is deprecated. In Odoo 19.0, you should use env.ref().id instead. Replace self.env["ir.model.data"]._xmlid_to_res_id("mail_activity_unlink_log.mt_activities_unlink") with self.env.ref("mail_activity_unlink_log.mt_activities_unlink").id

Suggested change
subtype_id=self.env["ir.model.data"]._xmlid_to_res_id(
"mail_activity_unlink_log.mt_activities_unlink"
),
subtype_id=self.env.ref(
"mail_activity_unlink_log.mt_activities_unlink"
).id,

Copilot uses AI. Check for mistakes.
class TestActivityUnlink(BaseCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test class uses self.partner without initializing it in the setUpClass method. BaseCommon does not provide a partner attribute by default. You should add cls.partner initialization in setUpClass, for example: cls.partner = cls.env.ref('base.res_partner_1') or cls.partner = cls.env['res.partner'].create({'name': 'Test Partner'})

Suggested change
super().setUpClass()
super().setUpClass()
cls.partner = cls.env.ref("base.res_partner_1")

Copilot uses AI. Check for mistakes.
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Project-Id-Version header still references "Odoo Server 14.0" but this is a migration to 19.0. This should be updated to "Odoo Server 19.0" to match the module version in manifest.py.

Suggested change
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 19.0\n"

Copilot uses AI. Check for mistakes.
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Project-Id-Version header still references "Odoo Server 14.0" but this is a migration to 19.0. This should be updated to "Odoo Server 19.0" to match the module version in manifest.py.

Suggested change
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 19.0\n"

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build-system.requires entry uses an unpinned third-party build backend (whool), which means every build can fetch an arbitrary, potentially compromised version of that package and execute it with access to your build environment and artifacts. An attacker who controls or poisons the whool package on the package index could tamper with built wheels or exfiltrate secrets from CI runners. Pin whool to a specific, vetted version (or other immutable identifier) to reduce supply-chain risk in the build step.

Copilot uses AI. Check for mistakes.
@TheSumitBasak TheSumitBasak mentioned this pull request Dec 26, 2025
5 tasks
@pedrobaeza
Copy link
Member

Please move this to OCA/mail instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants