-
-
Notifications
You must be signed in to change notification settings - Fork 107
[19.0][MIG] mail_activity_unlink_log: migrate to 19.0 #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Changes from all commits
d1bfb20
6d9c3de
fbdc1d5
9d66bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| .. image:: https://odoo-community.org/readme-banner-image | ||
| :target: https://odoo-community.org/get-involved?utm_source=readme | ||
| :alt: Odoo Community Association | ||
|
|
||
| ============================== | ||
| Mail Activities: log on unlink | ||
| ============================== | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:9196aedd490fc01c791256582122032365ce7d26a11a5c0e13b2ae66777b06c3 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/mail/tree/19.0/mail_activity_unlink_log | ||
| :alt: OCA/mail | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_activity_unlink_log | ||
| :alt: Translate me on Weblate | ||
| .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
| :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=19.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This addon enforces the creation of a message when an activity is | ||
| unlinked. This change tries to avoid a possible bad practice of deletion | ||
| of an activity without notifying the deletion. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_activity_unlink_log%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * CreuBlanca | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Enric Tobella | ||
| - Sumit Basak (`@TheSumitBasak <https://github.com/TheSumitBasak>`__) | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| This module is maintained by the OCA. | ||
|
|
||
| .. image:: https://odoo-community.org/logo.png | ||
| :alt: Odoo Community Association | ||
| :target: https://odoo-community.org | ||
|
|
||
| OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
| mission is to support the collaborative development of Odoo features and | ||
| promote its widespread use. | ||
|
|
||
| This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/19.0/mail_activity_unlink_log>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Copyright 2023 CreuBlanca | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| { | ||
| "name": "Mail Activities: log on unlink", | ||
| "summary": """ | ||
| Leave a message when an activity is unlinked""", | ||
| "version": "19.0.1.0.0", | ||
| "license": "AGPL-3", | ||
| "author": "CreuBlanca,Odoo Community Association (OCA)", | ||
| "website": "https://github.com/OCA/mail", | ||
| "depends": ["mail"], | ||
| "data": ["data/unlink_message.xml"], | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <odoo> | ||
| <data noupdate="1"> | ||
| <record id="mt_activities_unlink" model="mail.message.subtype"> | ||
| <field name="name">Activities unlink</field> | ||
| <field name="default" eval="True" /> | ||
| <field name="internal" eval="True" /> | ||
| <field name="sequence" eval="90" /> | ||
| </record> | ||
| </data> | ||
| <data> | ||
| <template id="message_activity_unlink"> | ||
| <div> | ||
| <p> | ||
| <span | ||
| t-attf-class="fa #{activity.activity_type_id.icon} fa-fw" | ||
| /><span t-field="activity.activity_type_id.name" /> deleted | ||
| <t t-if="display_assignee"> (originally assigned to <span | ||
| t-field="activity.user_id.name" | ||
| />)</t> | ||
| <span t-if="activity.summary">: </span><span | ||
| t-if="activity.summary" | ||
| t-field="activity.summary" | ||
| /> | ||
| </p> | ||
| <t | ||
| t-if="activity.note and activity.note != '<p><br></p>'" | ||
| > | ||
| <!-- <p></br></p> --> | ||
| <div class="o_mail_note_title"> | ||
| <strong>Original note:</strong> | ||
| </div> | ||
| <div t-field="activity.note" /> | ||
| </t> | ||
| </div> | ||
| </template> | ||
| </data> | ||
| </odoo> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * mail_activity_unlink_log | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 14.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2024-01-28 11:33+0000\n" | ||
| "Last-Translator: Ivorra78 <[email protected]>\n" | ||
| "Language-Team: none\n" | ||
| "Language: es\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
| "X-Generator: Weblate 4.17\n" | ||
|
|
||
| #. module: mail_activity_unlink_log | ||
| #: model_terms:ir.ui.view,arch_db:mail_activity_unlink_log.message_activity_unlink | ||
| msgid "(originally assigned to" | ||
| msgstr "(originalmente asignado a" | ||
|
|
||
| #. module: mail_activity_unlink_log | ||
| #: model_terms:ir.ui.view,arch_db:mail_activity_unlink_log.message_activity_unlink | ||
| msgid "<strong>Original note:</strong>" | ||
| msgstr "<strong>Nota original:</strong>" | ||
|
|
||
| #. module: mail_activity_unlink_log | ||
| #: model:mail.message.subtype,name:mail_activity_unlink_log.mt_activities_unlink | ||
| msgid "Activities unlink" | ||
| msgstr "Desvincular actividades" | ||
|
|
||
| #. module: mail_activity_unlink_log | ||
| #: model:ir.model,name:mail_activity_unlink_log.model_mail_activity | ||
| msgid "Activity" | ||
| msgstr "Actividades" | ||
|
|
||
| #. module: mail_activity_unlink_log | ||
| #: model:ir.model,name:mail_activity_unlink_log.model_mail_activity_mixin | ||
| msgid "Activity Mixin" | ||
| msgstr "Mezclador de Actividad" | ||
|
|
||
| #. module: mail_activity_unlink_log | ||
| #: model_terms:ir.ui.view,arch_db:mail_activity_unlink_log.message_activity_unlink | ||
| msgid "deleted" | ||
| msgstr "borrado" | ||
|
|
||
| #~ msgid "Display Name" | ||
| #~ msgstr "Mostrar Nombre" | ||
|
|
||
| #~ msgid "ID" | ||
| #~ msgstr "ID" | ||
|
|
||
| #~ msgid "Last Modified on" | ||
| #~ msgstr "Última Modificación el" | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||
| # Translation of Odoo Server. | ||||||
| # This file contains the translation of the following modules: | ||||||
| # * mail_activity_unlink_log | ||||||
| # | ||||||
| msgid "" | ||||||
| msgstr "" | ||||||
| "Project-Id-Version: Odoo Server 14.0\n" | ||||||
|
||||||
| "Project-Id-Version: Odoo Server 14.0\n" | |
| "Project-Id-Version: Odoo Server 19.0\n" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||
| # Translation of Odoo Server. | ||||||
| # This file contains the translation of the following modules: | ||||||
| # * mail_activity_unlink_log | ||||||
| # | ||||||
| msgid "" | ||||||
| msgstr "" | ||||||
| "Project-Id-Version: Odoo Server 18.0\n" | ||||||
|
||||||
| "Project-Id-Version: Odoo Server 18.0\n" | |
| "Project-Id-Version: Odoo Server 19.0\n" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import mail_activity |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Copyright 2023 CreuBlanca | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import models | ||
|
|
||
|
|
||
| class MailActivity(models.Model): | ||
| _inherit = "mail.activity" | ||
|
|
||
| def _action_done(self, *args, **kwargs): | ||
| return super( | ||
| MailActivity, self.with_context(activity_unlink_no_message=True) | ||
| )._action_done(*args, **kwargs) | ||
|
|
||
| def unlink(self): | ||
| if not self.env.context.get("activity_unlink_no_message"): | ||
| for activity in self: | ||
| record = self.env[activity.res_model].browse(activity.res_id) | ||
| record.message_post_with_source( | ||
| "mail_activity_unlink_log.message_activity_unlink", | ||
| render_values={ | ||
| "activity": activity, | ||
| "display_assignee": activity.user_id != self.env.user, | ||
| }, | ||
| subtype_id=self.env["ir.model.data"]._xmlid_to_res_id( | ||
| "mail_activity_unlink_log.mt_activities_unlink" | ||
| ), | ||
| mail_activity_type_id=activity.activity_type_id.id, | ||
| ) | ||
| return super().unlink() | ||
|
|
||
|
|
||
| class MailActivityMixin(models.AbstractModel): | ||
| _inherit = "mail.activity.mixin" | ||
|
|
||
| def unlink(self): | ||
| return super( | ||
| MailActivityMixin, self.with_context(activity_unlink_no_message=True) | ||
| ).unlink() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - Enric Tobella | ||
| - Sumit Basak ([@TheSumitBasak](https://github.com/TheSumitBasak)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| This addon enforces the creation of a message when an activity is | ||
| unlinked. This change tries to avoid a possible bad practice of deletion | ||
| of an activity without notifying the deletion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Project-Id-Version still references "Odoo Server 14.0" but this module is being migrated to version 19.0. This should be updated to "Odoo Server 19.0" to match the target version.