Closed ghost closed 2 years ago
Can you please do the PR changing the call?
Hey @pedrobaeza , I will give it a shot shortly, just be aware I am still a Python novice.
Give it a try and tell me.
@pedrobaeza Done and tested on my production 15 install was easier then I imagined :)
Great, closing in favor of the pull request
Module
Mail Tracking
Describe the bug
Prior to installing the mail_tracking addon email's sent perfectly fine. Now that it is installed mail is still sending and receiving fine but a deprecation warning is logging to odoo.log Main line is :
2022-08-23 14:18:57,180 2710 WARNING dbname py.warnings: /home/odoo/addons/mail_tracking/models/ir_mail_server.py:16: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
To Reproduce
Steps to reproduce the behavior:
Expected behavior Email sends and all should be well
Additional context Server: Vultr KVM based VPS Cores: 1vpcu Ram: 1024MB Storage: 25GB NVME OS: Fedora 36 Python: 3.10 Odoo: 15 community latest version pulled fresh I did have to modify the odoo requirements file for pip to bump the python-ldap library as our staff all use an IPA server for authentication.
Installed Addons
Server Logs
2022-08-23 14:18:57,180 2710 WARNING nts py.warnings: /home/odoo/addons/mail_tracking/models/ir_mail_server.py:16: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
File "/usr/lib64/python3.10/threading.py", line 973, in _bootstrap self._bootstrap_inner()
File "/usr/lib64/python3.10/threading.py", line 1016, in _bootstrap_inner self.run()
File "/usr/lib64/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs)
File "/home/odoo/odoo/odoo/service/server.py", line 1062, in _runloop self.process_work()
File "/home/odoo/odoo/odoo/service/server.py", line 1101, in process_work self.process_request(client, addr)
File "/home/odoo/odoo/odoo/service/server.py", line 1092, in process_request self.server.process_request(client, addr)
File "/usr/lib64/python3.10/socketserver.py", line 347, in process_request self.finish_request(request, client_address)
File "/usr/lib64/python3.10/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self)
File "/usr/lib64/python3.10/socketserver.py", line 747, in __init__ self.handle()
File "/home/odoo/python3.10-venv/lib64/python3.10/site-packages/werkzeug/serving.py", line 342, in handle BaseHTTPRequestHandler.handle(self)
File "/usr/lib64/python3.10/http/server.py", line 432, in handle self.handle_one_request()
File "/home/odoo/python3.10-venv/lib64/python3.10/site-packages/werkzeug/serving.py", line 374, in handle_one_request self.run_wsgi()
File "/home/odoo/python3.10-venv/lib64/python3.10/site-packages/werkzeug/serving.py", line 319, in run_wsgi execute(self.server.app)
File "/home/odoo/python3.10-venv/lib64/python3.10/site-packages/werkzeug/serving.py", line 308, in execute application_iter = app(environ, start_response)
File "/home/odoo/odoo/odoo/service/wsgi_server.py", line 110, in application return ProxyFix(application_unproxied)(environ, start_response)
File "/home/odoo/python3.10-venv/lib64/python3.10/site-packages/werkzeug/middleware/proxy_fix.py", line 187, in __call__ return self.app(environ, start_response)
File "/home/odoo/odoo/odoo/service/wsgi_server.py", line 87, in application_unproxied result = odoo.http.root(environ, start_response)
File "/home/odoo/odoo/odoo/http.py", line 1336, in __call__ return self.dispatch(environ, start_response)
File "/home/odoo/odoo/odoo/http.py", line 1302, in __call__ return self.app(environ, start_wrapped)
File "/home/odoo/python3.10-venv/lib64/python3.10/site-packages/werkzeug/middleware/shared_data.py", line 287, in __call__ return self.app(environ, start_response)
File "/home/odoo/odoo/odoo/http.py", line 1509, in dispatch with request_manager:
File "/home/odoo/odoo/odoo/http.py", line 264, in __exit__ self._cr.commit()
File "<decorator-gen-7>", line 2, in commit
File "/home/odoo/odoo/odoo/sql_db.py", line 90, in check return f(self, *args, **kwargs)
File "/home/odoo/odoo/odoo/sql_db.py", line 475, in commit self.postcommit.run()
File "/home/odoo/odoo/odoo/tools/misc.py", line 1139, in run func()
File "/home/odoo/odoo/addons/mail/models/mail_thread.py", line 2346, in send_notifications env['mail.mail'].browse(email_ids).send()
File "/home/odoo/odoo/addons/mail/models/mail_mail.py", line 356, in send self.browse(batch_ids)._send(
File "/home/odoo/odoo/addons/mail/models/mail_mail.py", line 447, in _send msg = IrMailServer.build_email(
File "/home/odoo/addons/mail_tracking/models/ir_mail_server.py", line 46, in build_email headers = self._tracking_headers_add(tracking_email_id, headers)
File "/home/odoo/addons/mail_tracking/models/ir_mail_server.py", line 16, in _tracking_headers_add headers["X-Odoo-Database"] = getattr(threading.currentThread(), "dbname", None)