diff --git a/api_log_mail/README.rst b/api_log_mail/README.rst index ca52bc4cd..144de1437 100644 --- a/api_log_mail/README.rst +++ b/api_log_mail/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ==================== API Log notification ==================== @@ -17,7 +13,7 @@ API Log notification .. |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 +.. |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%2Frest--framework-lightgray.png?logo=github diff --git a/api_log_mail/__manifest__.py b/api_log_mail/__manifest__.py index ba44854e3..df7dbfbdc 100644 --- a/api_log_mail/__manifest__.py +++ b/api_log_mail/__manifest__.py @@ -16,4 +16,5 @@ "api_log", "mail", ], + "data": ["data/mail_template.xml"], } diff --git a/api_log_mail/data/mail_template.xml b/api_log_mail/data/mail_template.xml new file mode 100644 index 000000000..84d215787 --- /dev/null +++ b/api_log_mail/data/mail_template.xml @@ -0,0 +1,47 @@ + + + + + FastAPI: Error + + {{object.collection_ref.user_id.email or object.env.ref('base.partner_root').email}} + {{object.collection_ref.company_id.scheduler_error_email_address}} + Odoo FastAPI Error + + +
+ + + + + + + +

Error in FastAPI call

+

FastAPI endpoint:

+

Request: []

+

+ Headers: +

    +
  • + : +
  • +
+

+

+ Exception: +

+

+ Stack trace:

+                

+
+
+
+
diff --git a/api_log_mail/models/api_log_collection.py b/api_log_mail/models/api_log_collection.py index cf7a87336..7d79cd93b 100644 --- a/api_log_mail/models/api_log_collection.py +++ b/api_log_mail/models/api_log_collection.py @@ -12,6 +12,9 @@ class APILogCollection(models.AbstractModel): domain=[("model_id.model", "=", "api.log")], string="Error E-mail Template", help="An email based on this template will be sent when an error is logged.", + default=lambda self: self.env.ref( + "api_log_mail.email_template_fastapi_error", False + ), ) api_log_mail_exception_activity_type_id = fields.Many2one( comodel_name="mail.activity.type", diff --git a/api_log_mail/static/description/index.html b/api_log_mail/static/description/index.html index 7a14118e3..7fcf2246f 100644 --- a/api_log_mail/static/description/index.html +++ b/api_log_mail/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +API Log notification -
+
+

API Log notification

- - -Odoo Community Association - -
-

API Log notification

-

Beta License: AGPL-3 OCA/rest-framework Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/rest-framework Translate me on Weblate Try me on Runboat

This module allows to create an activity when an exception is logged in an API logs collection.

Table of contents

@@ -391,12 +386,12 @@

API Log notification

-

Configuration

+

Configuration

In any log collection that has logging enabled, insert an activity type in “Error Activity type”.

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub 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 @@ -404,15 +399,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • PyTech
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -436,6 +431,5 @@

Maintainers

-