# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1733753226 -3600
#      Mon Dec 09 15:07:06 2024 +0100
# Branch 18.0
# Node ID 92e6a04b848eddd1d9bdc6afef488c51984d6000
# Parent  648fa1f05f6e236319c91e5b08159b9b3ee285a1
Remove mail dependency and adapt test and CI to run mail dependant tests anyway

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,8 @@
 include:
   - project: xcg/ci-templates
     file: /odoo/18.0/gitlab-ci.yaml
+
+variables:
+  TEST_OPTIONS: --test-tags=odoo_addons_mail
+  # Also install mail to run mail dependant tets
+  ODOO_SCRIPTS_MODULE_LIST: mail
diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1,6 +1,11 @@
 Changelog
 =========
 
+18.0.2.2.0
+----------
+
+Remove mail dependency, to avoid forcing its installation, only needed when using some specific converters.
+
 18.0.2.1.0
 ----------
 
diff --git a/__manifest__.py b/__manifest__.py
--- a/__manifest__.py
+++ b/__manifest__.py
@@ -21,11 +21,11 @@
     "name": "Converter",
     "license": "AGPL-3",
     "summary": "Convert odoo records to/from plain data structures.",
-    "version": "18.0.2.1.0",
+    "version": "18.0.2.2.0",
     "category": "Hidden",
     "author": "XCG Consulting",
     "website": "https://orbeet.io/",
-    "depends": ["mail"],
+    "depends": ["base"],
     "installable": True,
     "external_dependencies": {"python": ["fastjsonschema"]},
 }
diff --git a/mail_template.py b/mail_template.py
--- a/mail_template.py
+++ b/mail_template.py
@@ -29,6 +29,8 @@
     """This converter wraps ``mail.template::_render_template``.
     Multiple records are allowed but ``mail.template::_render_template`` still
     runs once per record; to accomodate, we provide ``ctx["records"]``.
+
+    Using this converter requires the mail module to be installed.
     """
 
     def __init__(self, template: str, post_eval: bool = False):
diff --git a/tests/test_mail_template.py b/tests/test_mail_template.py
--- a/tests/test_mail_template.py
+++ b/tests/test_mail_template.py
@@ -1,7 +1,7 @@
 ##############################################################################
 #
 #    Converter Odoo module
-#    Copyright © 2023 XCG Consulting <https://xcg-consulting.fr>
+#    Copyright © 2023, 2024 XCG Consulting <https://xcg-consulting.fr>
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU Affero General Public License as
@@ -20,9 +20,10 @@
 
 from odoo import tests  # type: ignore[import-untyped]
 
-from .. import MailTemplate
+from ..mail_template import MailTemplate
 
 
+@tests.tagged("-standard", "odoo_addons_mail")
 class Test(tests.TransactionCase):
     """Test converter that wraps ``mail.template::_render_template``."""