diff --git a/api_log_mail/__manifest__.py b/api_log_mail/__manifest__.py index 3a5de78b3..3bcc793ce 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..eef55a2ed --- /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",