Tuesday, January 16, 2024
2 changes
Resolved issues and error corrections
This fix resolves a critical error that prevented customers from adding a new shipping address during the checkout process. When users clicked "Add address" and attempted to save, the system would crash with an error message. The fix ensures that the address form displays properly with validation messages for missing required fields, allowing customers to complete their purchases successfully.
Original PR description
**Impacted versions:** master, 17.0 **Description of the issue this PR addresses:** Potential error when trying to create a new shipping address during the website checkout process. This appears to…
**Impacted versions:** master, 17.0
**Description of the issue this PR addresses:** Potential error when trying to create a new shipping address during the website checkout process.
This appears to have been introduced by 24c8ff9b28e9357d00a0a41447d9898dcf42995a on #139474.
**Steps to reproduce:**
1. Log in as admin user
* _The error also happens while logged in as portal user, but they do not see the traceback._
2. Go to website, add item to cart, and click "Checkout"
3. Under the "shipping' section, click "Add address"
4. Click save and an error is raised (see traceback below and in task comments)
* _The error also occurs if you just leave one required field as blank, rather than all fields._
**Current behavior before PR:** If logged in as an internal user, a traceback error (below) is raised. If logged in as a portal user, a 500 error page is shown.
* **Video link:** https://github.com/odoo/odoo/assets/7907616/4e103c73-417f-4d1a-93e3-8c1d7beeb918
* <details>
<summary>Traceback error...</summary>
```
Traceback (most recent call last):
File "/opt/odoo/core/odoo/http.py", line 1722, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/core/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/core/odoo/http.py", line 1749, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/core/odoo/http.py", line 1866, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/core/addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "/opt/odoo/core/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/core/odoo/http.py", line 722, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/core/addons/website_sale/controllers/main.py", line 1346, in address
'use_same': is_public_user or ('use_same' in kw and str2bool(kw.get('use_same'))),
File "/opt/odoo/core/odoo/tools/misc.py", line 468, in str2bool
raise ValueError('Use 0/1/yes/no/true/false/on/off')
ValueError: Use 0/1/yes/no/true/false/on/off
```
</details>
**Desired behavior after PR is merged:** The "add address" page is shown with a red highlight around any required fields that are missing a value.
* [image](https://github.com/odoo/odoo/assets/7907616/16fc616a-224f-4839-9b14-93e06829fadd)
Support ticket number submitted via odoo.com/help: opw-3685876. Closes #149428.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis update fixes a problem with how Odoo's email server handles secure connections. A previous change tried to use a different SSL library that wasn't compatible with Odoo's email system, causing connection failures. This fix reverts to the standard, reliable SSL approach to ensure emails can be sent securely without interruption.
Original PR description
This reverts commit 6c59eea4215e38cb1253b6172e776cf7a4978ad3. smtplib is expecting the Context of ssl found in the stdlib and the Context object of the pyOpenSSL lib isn't a drop in replacement. The various `TLS_METHOD` constants are not the same and the Context object of pyOpenSSL lack a `wrap_socket`-like method. opw-3640374 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#149414