-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UPD] Remove an unnecessary condition that may lead to overcomplexity…
… in real use cases
- Loading branch information
Showing
5 changed files
with
8 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
* `Akretion <https://www.akretion.com>`_: | ||
|
||
* Olivier Nibart | ||
|
||
* `Coop IT Easy <https://coopiteasy.be/>`_: | ||
|
||
* Pierrick Brun | ||
|
||
|
||
* JSC Boolit | ||
|
||
* Andrius Laukavičius |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1 @@ | ||
This modules allows to get a ticket back to its first state when a message is | ||
received about it. | ||
|
||
|
||
When you are in a non-production environment, you can reopen the ticket with | ||
a simple message as well. It is useful to test the module's function without | ||
preparing a fake mail environment. | ||
|
||
There is a function MailMessage.is_production_env() allowing to define how you | ||
select if you are in production or not. (With a check on the URL for instance) | ||
This module allows getting a ticket back to its initial state when a message is received about it, except if it is a notification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
# @author Olivier Nibart <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from unittest import mock | ||
|
||
from odoo.tests.common import SavepointCase | ||
|
||
|
@@ -29,7 +28,7 @@ def setUpClass(cls): | |
def test_is_reopener_message(self): | ||
vals = { | ||
"model": "not helpdesk.ticket", | ||
"message_type": "not comment or notification", | ||
"message_type": "not notification", | ||
} | ||
self.assertFalse(self.MailMessage.is_reopener_message(vals)) | ||
vals = { | ||
|
@@ -39,22 +38,7 @@ def test_is_reopener_message(self): | |
self.assertFalse(self.MailMessage.is_reopener_message(vals)) | ||
vals = { | ||
"model": "helpdesk.ticket", | ||
"message_type": "comment", | ||
} | ||
# type comment in production is not a reopener | ||
self.assertTrue(self.MailMessage.is_production_env()) | ||
self.assertFalse(self.MailMessage.is_reopener_message(vals)) | ||
# type comment not in production is a reopener | ||
with mock.patch.object( | ||
type(self.MailMessage), | ||
"is_production_env", | ||
return_value=False, | ||
): | ||
self.assertFalse(self.MailMessage.is_production_env()) | ||
self.assertTrue(self.MailMessage.is_reopener_message(vals)) | ||
vals = { | ||
"model": "helpdesk.ticket", | ||
"message_type": "not comment or notification", | ||
"message_type": "not notification", | ||
} | ||
self.assertTrue(self.MailMessage.is_reopener_message(vals)) | ||
|
||
|