Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
108 changes: 108 additions & 0 deletions repair_notification/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
===================
Repair Notification
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3c3f7bfffa4d25e9a8fba4dadaef7e8ffd758a1c6b3d4afdb7edd0e1ecf6a49d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/licence-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%2Frepair-lightgray.png?logo=github
:target: https://github.com/OCA/repair/tree/16.0/repair_notification
:alt: OCA/repair
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/repair-16-0/repair-16-0-repair_notification
: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/repair&target_branch=16.0
:alt: Try me on Runboat

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

This module extends the standard Repair application to improve customer
communication during the repair process.

It adds new configuration options in the Repair application settings
allowing users to:

- Enable or disable automatic email notifications when a repair starts

- Enable or disable automatic email notifications when a repair ends

- Select a specific email template for each notification type (start and
end)

When enabled, an email is automatically sent to the customer:

- When the repair order moves to the in progress state

- When the repair order is completed

To avoid duplicate notifications, the module ensures that the “repair
start” email is sent only once per repair order. If a repair is started,
then cancelled, and later restarted, the customer will not receive the
start notification again.

**Table of contents**

.. contents::
:local:

Configuration
=============

- Go to Repair > Configuration > Settings
- Activate Repair Start Confirmation Email > Select the Email Template >
save
- Activate Repair End Confirmation Email > Select the Email Template >
save

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/repair/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/repair/issues/new?body=module:%20repair_notification%0Aversion:%2016.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
-------

* ACSONE SA/NV

Contributors
------------

- Nihel GABSI [email protected]
- Souheil BEJAOUI [email protected]

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/repair <https://github.com/OCA/repair/tree/16.0/repair_notification>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions repair_notification/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions repair_notification/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Repair Notification",
"summary": """Send mail notifications to the customer to inform about repair start/end""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/repair",
"depends": ["base_repair_config", "repair"],
"data": [
"views/res_config_settings.xml",
"data/mail_data.xml",
],
}
72 changes: 72 additions & 0 deletions repair_notification/data/mail_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="mail_template_repair_start_notification" model="mail.template">
<field name="name">Repair Start Notification</field>
<field name="model_id" ref="repair.model_repair_order" />
<field name="email_from">{{object.user_id.email_formatted }}</field>
<field name="partner_to">{{object.partner_id.id}}</field>
<field
name="subject"
>Repair order (Ref {{object.name or 'n/a' }}) started</field>
<field name="lang">{{object.partner_id.lang}}</field>
<field name="auto_delete" eval="True" />
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear
<t t-out="object.partner_id.name" />
<t t-if="object.partner_id.parent_id">
<t t-out="object.partner_id.parent_id.name" />
</t>
<br />
<br />
We would like to inform you that the reparation of your product
<strong>
<t t-out="object.product_id.name" />
</strong>
is just started.
<br />
<br />
<t t-out="object.company_id.name" /> team.
<br />
<br />
</p>
</div>
</field>
</record>

<record id="mail_template_repair_end_notification" model="mail.template">
<field name="name">Repair End Notification</field>
<field name="model_id" ref="repair.model_repair_order" />
<field name="email_from">{{object.user_id.email_formatted }}</field>
<field name="partner_to">{{object.partner_id.id}}</field>
<field
name="subject"
>Repair order (Ref {{object.name or 'n/a' }}) ended</field>
<field name="lang">{{object.partner_id.lang}}</field>
<field name="auto_delete" eval="True" />
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear
<t t-out="object.partner_id.name" />
<t t-if="object.partner_id.parent_id">
<t t-out="object.partner_id.parent_id.name" />
</t>
<br />
<br />
We would like to inform you that the reparation of your product
<strong>
<t t-out="object.product_id.name" />
</strong>
is just ended.
<br />
<br />
<t t-out="object.company_id.name" /> team.
<br />
<br />
</p>
</div>
</field>
</record>
</odoo>
3 changes: 3 additions & 0 deletions repair_notification/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import res_config_settings
from . import res_company
from . import repair_order
40 changes: 40 additions & 0 deletions repair_notification/models/repair_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class RepairOrder(models.Model):

_inherit = "repair.order"

repair_start_mail_sent = fields.Boolean(default=False, copy=False)

def write(self, vals):
res = super().write(vals)
if (
"state" in vals
and vals["state"] == "under_repair"
and not self.repair_start_mail_sent
):
self._send_repair_start_confirmation_email()
self.repair_start_mail_sent = True
elif "state" in vals and vals["state"] == "done":
self._send_repair_end_confirmation_email()
return res

def _send_repair_start_confirmation_email(self):
"""Send customer notification when the repair is started"""
for rec in self.filtered("company_id.send_repair_start_confirmation"):
repair_template_id = rec.company_id.repair_start_template_id.id
rec.with_context(
force_send=True,
).message_post_with_template(repair_template_id)

def _send_repair_end_confirmation_email(self):
"""Send customer notification when the repair is ended"""
for rec in self.filtered("company_id.send_repair_end_confirmation"):
repair_template_id = rec.company_id.repair_end_template_id.id
rec.with_context(
force_send=True,
).message_post_with_template(repair_template_id)
46 changes: 46 additions & 0 deletions repair_notification/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):

_inherit = "res.company"

def _default_repair_start_template(self):
try:
return self.env.ref(
"repair_notification.mail_template_repair_start_notification"
).id
except ValueError:
return False

def _default_repair_end_template(self):
try:
return self.env.ref(
"repair_notification.mail_template_repair_end_notification"
).id
except ValueError:
return False

send_repair_start_confirmation = fields.Boolean(
help="Notify the customer when repairing starts"
)
send_repair_end_confirmation = fields.Boolean(
help="Notify the customer when repairing ends"
)
repair_start_template_id = fields.Many2one(
comodel_name="mail.template",
string="Email Template confirmation for repair start",
domain="[('model', '=', 'repair.order')]",
default=_default_repair_start_template,
help="Email sent to the customer once the repair is started.",
)
repair_end_template_id = fields.Many2one(
comodel_name="mail.template",
string="Email Template confirmation for repair end",
domain="[('model', '=', 'repair.order')]",
default=_default_repair_end_template,
help="Email sent to the customer once the repair is ended.",
)
26 changes: 26 additions & 0 deletions repair_notification/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):

_inherit = "res.config.settings"

send_repair_start_confirmation = fields.Boolean(
related="company_id.send_repair_start_confirmation",
readonly=False,
)
repair_start_template_id = fields.Many2one(
related="company_id.repair_start_template_id",
readonly=False,
)
send_repair_end_confirmation = fields.Boolean(
related="company_id.send_repair_end_confirmation",
readonly=False,
)
repair_end_template_id = fields.Many2one(
related="company_id.repair_end_template_id",
readonly=False,
)
3 changes: 3 additions & 0 deletions repair_notification/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Go to Repair > Configuration > Settings
- Activate Repair Start Confirmation Email > Select the Email Template > save
- Activate Repair End Confirmation Email > Select the Email Template > save
2 changes: 2 additions & 0 deletions repair_notification/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Nihel GABSI <[email protected]>
- Souheil BEJAOUI <[email protected]>
18 changes: 18 additions & 0 deletions repair_notification/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
This module extends the standard Repair application to improve customer communication during the repair process.

It adds new configuration options in the Repair application settings allowing users to:

- Enable or disable automatic email notifications when a repair starts

- Enable or disable automatic email notifications when a repair ends

- Select a specific email template for each notification type (start and end)

When enabled, an email is automatically sent to the customer:

- When the repair order moves to the in progress state

- When the repair order is completed

To avoid duplicate notifications, the module ensures that the “repair start” email is sent only once per repair order.
If a repair is started, then cancelled, and later restarted, the customer will not receive the start notification again.
Binary file added repair_notification/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading