Skip to content

Commit c85b244

Browse files
committed
[MIG] fastapi_log_mail: Migration to 17.0
1 parent 16ec3bd commit c85b244

7 files changed

Lines changed: 25 additions & 93 deletions

File tree

fastapi_log_mail/README.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.. image:: https://odoo-community.org/readme-banner-image
2-
:target: https://odoo-community.org/get-involved?utm_source=readme
3-
:alt: Odoo Community Association
4-
51
========================
62
FastAPI Log notification
73
========================
@@ -17,17 +13,17 @@ FastAPI Log notification
1713
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1814
:target: https://odoo-community.org/page/development-status
1915
:alt: Beta
20-
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
2117
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2218
:alt: License: AGPL-3
2319
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
24-
:target: https://github.com/OCA/rest-framework/tree/16.0/fastapi_log_mail
20+
:target: https://github.com/OCA/rest-framework/tree/17.0/fastapi_log_mail
2521
:alt: OCA/rest-framework
2622
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-fastapi_log_mail
23+
:target: https://translation.odoo-community.org/projects/rest-framework-17-0/rest-framework-17-0-fastapi_log_mail
2824
:alt: Translate me on Weblate
2925
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=17.0
3127
:alt: Try me on Runboat
3228

3329
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +47,7 @@ Bug Tracker
5147
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/issues>`_.
5248
In case of trouble, please check there if your issue has already been reported.
5349
If you spotted it first, help us to smash it by providing a detailed and welcomed
54-
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_log_mail%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
50+
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_log_mail%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5551

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

@@ -91,6 +87,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
9187

9288
|maintainer-SirPyTech|
9389

94-
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/16.0/fastapi_log_mail>`_ project on GitHub.
90+
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/17.0/fastapi_log_mail>`_ project on GitHub.
9591

9692
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

fastapi_log_mail/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "FastAPI Log notification",
6-
"version": "16.0.1.1.0",
6+
"version": "17.0.1.0.0",
77
"license": "AGPL-3",
88
"author": "PyTech, Odoo Community Association (OCA)",
99
"maintainers": [

fastapi_log_mail/migrations/16.0.1.1.0/post-migration.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

fastapi_log_mail/migrations/16.0.1.1.0/pre-migration.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

fastapi_log_mail/static/description/index.html

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>README.rst</title>
6+
<title>FastAPI Log notification</title>
77
<style type="text/css">
88

99
/*
@@ -360,21 +360,16 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document">
363+
<div class="document" id="fastapi-log-notification">
364+
<h1 class="title">FastAPI Log notification</h1>
364365

365-
366-
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367-
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368-
</a>
369-
<div class="section" id="fastapi-log-notification">
370-
<h1>FastAPI Log notification</h1>
371366
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
372367
!! This file is generated by oca-gen-addon-readme !!
373368
!! changes will be overwritten. !!
374369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375370
!! source digest: sha256:4b12481102fbeba3a2c70e1ee2357d064d81d9602f958ef866f232cac48e7c07
376371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/rest-framework/tree/16.0/fastapi_log_mail"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-fastapi_log_mail"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/rest-framework/tree/17.0/fastapi_log_mail"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/rest-framework-17-0/rest-framework-17-0-fastapi_log_mail"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378373
<p>This module allows to create an activity when an exception is logged in
379374
a fastapi endpoint.</p>
380375
<p><strong>Table of contents</strong></p>
@@ -391,27 +386,27 @@ <h1>FastAPI Log notification</h1>
391386
</ul>
392387
</div>
393388
<div class="section" id="configuration">
394-
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
389+
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
395390
<p>Configure a fastapi endpoint as explained in <tt class="docutils literal">api_log_mail</tt>.</p>
396391
</div>
397392
<div class="section" id="bug-tracker">
398-
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
393+
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
399394
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>.
400395
In case of trouble, please check there if your issue has already been reported.
401396
If you spotted it first, help us to smash it by providing a detailed and welcomed
402-
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_log_mail%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
397+
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_log_mail%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403398
<p>Do not contact contributors directly about support or help with technical issues.</p>
404399
</div>
405400
<div class="section" id="credits">
406-
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
401+
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
407402
<div class="section" id="authors">
408-
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
403+
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
409404
<ul class="simple">
410405
<li>PyTech</li>
411406
</ul>
412407
</div>
413408
<div class="section" id="contributors">
414-
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
409+
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
415410
<ul class="simple">
416411
<li><a class="reference external" href="https://www.pytech.it">PyTech</a>:<ul>
417412
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;pytech.it">simone.rubino&#64;pytech.it</a>&gt;</li>
@@ -420,7 +415,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
420415
</ul>
421416
</div>
422417
<div class="section" id="maintainers">
423-
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
418+
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
424419
<p>This module is maintained by the OCA.</p>
425420
<a class="reference external image-reference" href="https://odoo-community.org">
426421
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -430,11 +425,10 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
430425
promote its widespread use.</p>
431426
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
432427
<p><a class="reference external image-reference" href="https://github.com/SirPyTech"><img alt="SirPyTech" src="https://github.com/SirPyTech.png?size=40px" /></a></p>
433-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/16.0/fastapi_log_mail">OCA/rest-framework</a> project on GitHub.</p>
428+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/17.0/fastapi_log_mail">OCA/rest-framework</a> project on GitHub.</p>
434429
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
435430
</div>
436431
</div>
437432
</div>
438-
</div>
439433
</body>
440434
</html>

fastapi_log_mail/tests/test_fastapi_log_mail.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import os
77
import unittest
88

9+
from odoo.tools import mute_logger
10+
911
from odoo.addons.fastapi.schemas import DemoExceptionType
1012
from odoo.addons.fastapi_log.tests.common import Common
1113
from odoo.addons.mail.tests.common import MailCase
@@ -50,7 +52,7 @@ def test_endpoint_exception_create_activity(self):
5052
self.assertTrue(activity_type)
5153

5254
# Act
53-
with self.log_capturer() as capturer:
55+
with self.log_capturer() as capturer, mute_logger("odoo.http"):
5456
response = self.url_open(route, timeout=200)
5557

5658
# Assert
@@ -76,7 +78,7 @@ def test_endpoint_exception_send_email(self):
7678
self.assertTrue(mail_template)
7779

7880
# Act
79-
with self.mock_mail_gateway():
81+
with self.mock_mail_gateway(), mute_logger("odoo.http"):
8082
self.url_open(route, timeout=200)
8183

8284
# Assert

fastapi_log_mail/views/fastapi_endpoint_views.xml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@
1313
<field
1414
name="api_log_mail_exception_activity_type_id"
1515
groups="api_log.group_api_log"
16-
attrs="{
17-
'invisible': [
18-
('log_requests', '=', False),
19-
],
20-
}"
16+
invisible="not log_requests"
2117
/>
2218
<field
2319
name="api_log_mail_exception_template_id"
2420
groups="api_log.group_api_log"
25-
attrs="{
26-
'invisible': [
27-
('log_requests', '=', False),
28-
],
29-
}"
21+
invisible="not log_requests"
3022
/>
3123
</field>
3224
</field>

0 commit comments

Comments
 (0)