|
13 | 13 |
|
14 | 14 | from odoo import _, api, fields, models, tools |
15 | 15 | from odoo.exceptions import ValidationError |
| 16 | +from odoo.tools import mute_logger |
16 | 17 |
|
17 | 18 | from ..exceptions import ( |
18 | 19 | AmbiguousJwtValidator, |
@@ -251,19 +252,21 @@ def _register_hook(self): |
251 | 252 |
|
252 | 253 | def _register_auth_method(self): |
253 | 254 | IrHttp = self.env["ir.http"] |
254 | | - for rec in self: |
255 | | - setattr( |
256 | | - IrHttp.__class__, |
257 | | - f"_auth_method_jwt_{rec.name}", |
258 | | - partial(IrHttp.__class__._auth_method_jwt, validator_name=rec.name), |
259 | | - ) |
260 | | - setattr( |
261 | | - IrHttp.__class__, |
262 | | - f"_auth_method_public_or_jwt_{rec.name}", |
263 | | - partial( |
264 | | - IrHttp.__class__._auth_method_public_or_jwt, validator_name=rec.name |
265 | | - ), |
266 | | - ) |
| 255 | + with mute_logger("odoo.tests.common"): # Mute patch checker during tests |
| 256 | + for rec in self: |
| 257 | + setattr( |
| 258 | + IrHttp.__class__, |
| 259 | + f"_auth_method_jwt_{rec.name}", |
| 260 | + partial(IrHttp.__class__._auth_method_jwt, validator_name=rec.name), |
| 261 | + ) |
| 262 | + setattr( |
| 263 | + IrHttp.__class__, |
| 264 | + f"_auth_method_public_or_jwt_{rec.name}", |
| 265 | + partial( |
| 266 | + IrHttp.__class__._auth_method_public_or_jwt, |
| 267 | + validator_name=rec.name, |
| 268 | + ), |
| 269 | + ) |
267 | 270 |
|
268 | 271 | def _unregister_auth_method(self): |
269 | 272 | IrHttp = self.env["ir.http"] |
|
0 commit comments