summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_performance.py
diff options
context:
space:
mode:
authorAntoine Prieels (ANP) <anp@odoo.com>2018-12-17 08:27:11 +0000
committerPierre Masereel <pim@odoo.com>2019-01-24 13:36:51 +0000
commit8f486db52da052ae6f6b979a83f85d5d2c0ed269 (patch)
treeab0b12feb0b0f3618b5c2174dd585259587340de /addons/test_mail/tests/test_performance.py
parent7274c0aa74cbbd221b5bbb941314e4b12af956ee (diff)
[IMP] mail, snailmail, snailmail_account: improve error management
When a letter is sent through snailmail and encounter an error, it used to create an activity to the user to notify him that there was an error with its letter. When a user had this activity, he didn't have any clues of what was the error and how to manage it. So we decided to better handle snailmail errors and give the possibility to the user to easily fix the source of the snailmail errors. First to give a better feedback on the letters in errors, we've made features similar to ones existing for emails: - We add a mail message on the document that sent the letter, and put a small paper plane icon, which is red when an error occurs (like the envelope for email) - As letters can be sent in batch, we've also added an entry in the systray to easily manage the different documents having snailmail errors like for emails. Then we identified, the most common errors encountered with the snailmail letters and give proper way to let the user fix them: - Missing Required Field: - The address is not complete, some of the fields are empty. - We open a wizard allowing the user to modify the partner address and we try to resend all letters having this error on the modified partner. - We also try to avoid this error, by opening the wizard before sending the letter, but it only works for single documents, not for batch. - Trial/Credit Error: - The user has not enough credits to send letters anymore. - We open a wizard that give a redirection lnk to add credits on its iap account. - No Price Available: - The destination country is not supported by any of our providers, and we cannot do anything to send this letter. - Format Error: - The format of the pdf report send by the user is refused by our providers, because some visual stuffs are not respected, for example blank zone to print barcode or margins. - We show a wizard to the user letting him check a setting option that add a cover page in the envelope and the documents will be send with this extra page containing the address. - Unknown Error: - This is not one of the listed error above. - A wizard suggesting the user to contact support is displayed. The cron that try to resend letters on error, has been addapted to only try to send the error of type Trial/No Credit, because the account might have been reloaded, and other errors, won't change if they have not been fixed locally. closes odoo/odoo#29685
Diffstat (limited to 'addons/test_mail/tests/test_performance.py')
-rw-r--r--addons/test_mail/tests/test_performance.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index 3b4a2df8281..ff162bb1ecf 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -277,7 +277,7 @@ class TestAdvMailPerformance(TransactionCase):
def test_message_post_one_inbox_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(__system__=32, emp=44): # com runbot 31 - 43 // test_mail only: 32 - 44
+ with self.assertQueryCount(__system__=32, emp=46): # com runbot 31 - 45 // test_mail only: 32 - 44
record.message_post(
body='<p>Test Post Performances with an inbox ping</p>',
partner_ids=self.user_test.partner_id.ids,