Skip to content
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

17.0 mig mail notification custom subject #3

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7e44259
[ADD] mail_notification_custom_subject: Apply a custom subject to mai…
joao-p-marques Jan 5, 2021
cec4c07
[IMP] mail_notification_custom_subject: black, isort, prettier
CarlosRoca13 Feb 15, 2021
6fd81da
[MIG] mail_notification_custom_subject: Migration to v13.0
CarlosRoca13 Feb 16, 2021
1eae3ba
[IMP] mail_notification_custom_subject: Add comment to explain test_b…
victoralmau Apr 19, 2021
04734da
[IMP] mail_notification_custom_subject: black, isort, prettier
Aug 12, 2021
25c1828
[MIG] mail_notification_custom_subject: Migration to 14.0
Aug 12, 2021
709d566
[UPD] Update mail_notification_custom_subject.pot
oca-travis Aug 30, 2021
3522215
[FIX] mail_notification_custom_subject: Error modifying subtype_id
olgamarcocb Jan 24, 2022
254dc57
[MIG] mail_notification_custom_subject: Migration to 15.0
victoralmau Oct 19, 2022
4da2205
[UPD] Update mail_notification_custom_subject.pot
Oct 25, 2022
ae9c002
[UPD] README.rst
OCA-git-bot Oct 25, 2022
97d86d1
Update translation files
weblate Oct 25, 2022
c284baf
[FIX] mail_notification_custom_subject: do not require being admin to…
yajo Dec 2, 2022
36d7f7b
[BUILD] mail_notification_custom_subject: change maintainer
yajo Dec 2, 2022
8afaee2
[UPD] README.rst
OCA-git-bot Dec 2, 2022
f883410
mail_notification_custom_subject 15.0.1.0.1
OCA-git-bot Dec 2, 2022
44d8a03
[FIX] mail_notification_custom_subject: Use same approach as Odoo whe…
Shide Dec 14, 2022
99efd18
[UPD] README.rst
OCA-git-bot Dec 14, 2022
0df3fdb
mail_notification_custom_subject 15.0.1.0.2
OCA-git-bot Dec 14, 2022
7d02ad2
[IMP] mail_notification_custom_subject: add migration script for conv…
ernesto-garcia-tecnativa Mar 31, 2023
f8aecb6
[UPD] README.rst
OCA-git-bot Sep 3, 2023
af068ba
Added translation using Weblate (Spanish)
Ivorra78 Oct 20, 2023
f7b15d4
[IMP] mail_notification_custom_subject: pre-commit auto fixes
maciej-wichowski Apr 9, 2024
fde4ba0
[MIG] mail_notification_custom_subject: migration to 17.0
maciej-wichowski Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 36 additions & 28 deletions mail_notification_custom_subject/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ Mail Notification Custom Subject
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/15.0/mail_notification_custom_subject
:target: https://github.com/OCA/social/tree/17.0/mail_notification_custom_subject
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_notification_custom_subject
:target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_notification_custom_subject
: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/social&target_branch=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to specify templates to override the subject on the notification
emails sent by Odoo
This module allows you to specify templates to override the subject on
the notification emails sent by Odoo

**Table of contents**

Expand All @@ -39,60 +39,68 @@ emails sent by Odoo
Configuration
=============

- Activate access to **Technical Features** (debug mode).

* Activate access to **Technical Features** (debug mode).
* Go to **Settings > Technical > Email > Subject Replacement Templates**
* Create a new template.
- Go to **Settings > Technical > Email > Subject Replacement
Templates**

* The field **Model** specifies the model to which the subject template should apply in the notification emails sent by Odoo.
* The field **Subject Template** accepts `Jinja <https://jinja.palletsprojects.com/en/2.11.x/>`__ expressions.
* The field **Replace** specifies if the template should replace existing content or append to it.
- Create a new template.

- The field **Model** specifies the model to which the subject
template should apply in the notification emails sent by Odoo.
- The field **Subject Template** accepts
`Jinja <https://jinja.palletsprojects.com/en/2.11.x/>`__
expressions.
- The field **Replace** specifies if the template should replace
existing content or append to it.

Usage
=====

To use this module, you need to:

* Open the chatter in Odoo (e.g. Open an Invoice).
* Send a message.
* Observe the rendered Subject template.
- Open the chatter in Odoo (e.g. Open an Invoice).
- Send a message.
- Observe the rendered Subject template.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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/social/issues/new?body=module:%20mail_notification_custom_subject%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_notification_custom_subject%0Aversion:%2017.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
~~~~~~~
-------

* Tecnativa

Contributors
~~~~~~~~~~~~
------------

- Tecnativa <https://www.tecnativa.com>

- Pedro M. Baeza
- João Marques
- Carlos Roca
- Víctor Martínez

* Tecnativa <https://www.tecnativa.com>
- Versada <https://versada.eu>

* Pedro M. Baeza
* João Marques
* Carlos Roca
* Víctor Martínez
- Naglis Jonaitis

* Versada <https://versada.eu>
* Naglis Jonaitis
- Moduon <https://www.moduon.team>

* Moduon <https://www.moduon.team>
* Eduardo de Miguel
- Eduardo de Miguel

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -112,6 +120,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-yajo|

This module is part of the `OCA/social <https://github.com/OCA/social/tree/15.0/mail_notification_custom_subject>`_ project on GitHub.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/17.0/mail_notification_custom_subject>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 2 additions & 4 deletions mail_notification_custom_subject/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def message_post(
attachment_ids=None,
add_sign=True,
record_name=False,
**kwargs
**kwargs,
Copy link

@Drsmartinkus Drsmartinkus Apr 10, 2024

Choose a reason for hiding this comment

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

Do we need comma here? Or is that pre-commit thing?

Copy link
Author

Choose a reason for hiding this comment

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

It's a black thing I believe :)

):
if subtype_xmlid:
subtype_id = self.env["ir.model.data"]._xmlid_to_res_id(
Expand Down Expand Up @@ -60,9 +60,7 @@ def message_post(
template_src=template.subject_template,
model=self._name,
res_ids=[self.id],
)[
self.id
]
)[self.id]
if template.position == "replace":
subject = rendered_subject_template
elif template.position == "append_before":
Expand Down
3 changes: 3 additions & 0 deletions mail_notification_custom_subject/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
13 changes: 13 additions & 0 deletions mail_notification_custom_subject/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- Activate access to **Technical Features** (debug mode).

- Go to **Settings \> Technical \> Email \> Subject Replacement
Templates**

- Create a new template.

> - The field **Model** specifies the model to which the subject
> template should apply in the notification emails sent by Odoo.
> - The field **Subject Template** accepts
> [Jinja](https://jinja.palletsprojects.com/en/2.11.x/) expressions.
> - The field **Replace** specifies if the template should replace
> existing content or append to it.
8 changes: 0 additions & 8 deletions mail_notification_custom_subject/readme/CONFIGURE.rst

This file was deleted.

12 changes: 12 additions & 0 deletions mail_notification_custom_subject/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- Tecnativa \<<https://www.tecnativa.com>\>

> - Pedro M. Baeza
> - João Marques
> - Carlos Roca
> - Víctor Martínez

- Versada \<<https://versada.eu>\>
- Naglis Jonaitis

- Moduon \<<https://www.moduon.team>\>
- Eduardo de Miguel
12 changes: 0 additions & 12 deletions mail_notification_custom_subject/readme/CONTRIBUTORS.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This module allows you to specify templates to override the subject on the notification
emails sent by Odoo
This module allows you to specify templates to override the subject on
the notification emails sent by Odoo
5 changes: 5 additions & 0 deletions mail_notification_custom_subject/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

- Open the chatter in Odoo (e.g. Open an Invoice).
- Send a message.
- Observe the rendered Subject template.
5 changes: 0 additions & 5 deletions mail_notification_custom_subject/readme/USAGE.rst

This file was deleted.

38 changes: 18 additions & 20 deletions mail_notification_custom_subject/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -369,9 +368,9 @@ <h1 class="title">Mail Notification Custom Subject</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b873c6dfb9d094a1b5ebcd5c16a0c39a2127f4e7707aa54dd51dd4049f65d3fe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/social/tree/15.0/mail_notification_custom_subject"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_notification_custom_subject"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/social&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to specify templates to override the subject on the notification
emails sent by Odoo</p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/social/tree/17.0/mail_notification_custom_subject"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_notification_custom_subject"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/social&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to specify templates to override the subject on
the notification emails sent by Odoo</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -391,14 +390,19 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<ul>
<li><p class="first">Activate access to <strong>Technical Features</strong> (debug mode).</p>
</li>
<li><p class="first">Go to <strong>Settings &gt; Technical &gt; Email &gt; Subject Replacement Templates</strong></p>
<li><p class="first">Go to <strong>Settings &gt; Technical &gt; Email &gt; Subject Replacement
Templates</strong></p>
</li>
<li><p class="first">Create a new template.</p>
<blockquote>
<ul class="simple">
<li>The field <strong>Model</strong> specifies the model to which the subject template should apply in the notification emails sent by Odoo.</li>
<li>The field <strong>Subject Template</strong> accepts <a class="reference external" href="https://jinja.palletsprojects.com/en/2.11.x/">Jinja</a> expressions.</li>
<li>The field <strong>Replace</strong> specifies if the template should replace existing content or append to it.</li>
<li>The field <strong>Model</strong> specifies the model to which the subject
template should apply in the notification emails sent by Odoo.</li>
<li>The field <strong>Subject Template</strong> accepts
<a class="reference external" href="https://jinja.palletsprojects.com/en/2.11.x/">Jinja</a>
expressions.</li>
<li>The field <strong>Replace</strong> specifies if the template should replace
existing content or append to it.</li>
</ul>
</blockquote>
</li>
Expand All @@ -418,7 +422,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_notification_custom_subject%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_notification_custom_subject%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -442,21 +446,15 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</ul>
</blockquote>
</li>
<li><dl class="first docutils">
<dt>Versada &lt;<a class="reference external" href="https://versada.eu">https://versada.eu</a>&gt;</dt>
<dd><ul class="first last simple">
<li><p class="first">Versada &lt;<a class="reference external" href="https://versada.eu">https://versada.eu</a>&gt;</p>
<ul class="simple">
<li>Naglis Jonaitis</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>Moduon &lt;<a class="reference external" href="https://www.moduon.team">https://www.moduon.team</a>&gt;</dt>
<dd><ul class="first last simple">
<li><p class="first">Moduon &lt;<a class="reference external" href="https://www.moduon.team">https://www.moduon.team</a>&gt;</p>
<ul class="simple">
<li>Eduardo de Miguel</li>
</ul>
</dd>
</dl>
</li>
</ul>
</div>
Expand All @@ -469,7 +467,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/yajo"><img alt="yajo" src="https://github.com/yajo.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/15.0/mail_notification_custom_subject">OCA/social</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/17.0/mail_notification_custom_subject">OCA/social</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down