Thursday, April 18, 2024
3 changes · saas-17.1
Resolved issues and error corrections
This fixes an error that could prevent users from saving their portal information when no country was selected. The portal now handles an empty country field safely, avoiding a frustrating crash during profile updates.
Original PR description
Currently, the error arises when saving details in the portal view without selecting a country Steps to reproduce: - Install the 'account' module and turn on developer mode. - Navigate to Settings >…
Currently, the error arises when saving details in the portal view without selecting a country
Steps to reproduce:
- Install the 'account' module and turn on developer mode.
- Navigate to Settings > Users & Companies > Users and open the current user.
- Open the related partner.
- Click on 'Invoice' and create a new invoice.
- Add a product and confirm it.
- Go to portal view and click on 'Edit information'.
- Click on the 'Save' button.
Stack Trace
```
ValueError: invalid literal for int() with base 10: 'False'
File "<453>", line 531, in template_453
File "<453>", line 416, in template_453_content
QWebException: Error while render the template
ValueError: invalid literal for int() with base 10: 'False'
Template: ir.ui.view(453,)
Path: /t/div[13]/select/t/option
Node: <option t-att-value="country.id" t-att-selected="country.id == int(country_id) if country_id else country.id == partner.country_id.id"/>
File "odoo/http.py", line 2252, in __call__
response = request._serve_db()
File "odoo/http.py", line 1828, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1848, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1826, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1833, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1971, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 224, in _dispatch
result.flatten()
File "odoo/http.py", line 1321, in flatten
self.response.append(self.render())
File "odoo/http.py", line 1313, in render
return request.env["ir.ui.view"]._render_template(self.template, self.qcontext)
File "addons/website/models/ir_ui_view.py", line 442, in _render_template
return super()._render_template(template, values=values)
File "odoo/addons/base/models/ir_ui_view.py", line 2023, in _render_template
return self.env['ir.qweb']._render(template, values)
File "odoo/tools/profiler.py", line 302, in _tracked_method_render
return method_render(self, template, values, **options)
File "odoo/addons/base/models/ir_qweb.py", line 594, in _render
result = ''.join(rendering)
File "<454>", line 86, in template_454
File "<454>", line 68, in template_454_content
File "<454>", line 41, in template_454_t_call_0
File "<453>", line 539, in template_453
```
The issue occurs when attempting to save details in the portal view without selecting a country. At this point [1], a string "False" is passed as the 'country_id', and the system attempts to convert it into an integer using typecasting (int()).
link[1] : https://github.com/odoo/odoo/blob/fc55cd0ecb9e79ee4491537cc77baa0d57f1f3c7/addons/portal/views/portal_templates.xml#L500
To resolve this issue, the condition is added to ensure that only integer values are passed as a 'country_id'.
sentry-4959817278
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis change reverts a previous web automation adjustment and keeps the customer statements menu out of broad automated click testing. It helps avoid a known issue while the proper fix is handled in the related Enterprise change.
Original PR description
This reverts commit 05c669876a58afa450b946c35e6567d362b2afb5. The issue should be solve with the enterprise commit. https://github.com/odoo/enterprise/pull/60951
This fix changes how follow-up payment reminder data is temporarily stored so read-only customer searches are handled correctly. It prevents an internal database write from blocking or interfering with read-only operations, improving reliability without changing user workflows.
Original PR description
The readonly flag on `res_partner`.`search` was not respected because of `CREATE TEMP TABLE followup_data_cache`. It was used to create a transactional cache. Instead of putting this cache on the database side, put it on the Python side. On the Python side, the memory spike should be the same (we've retrieved all the data at some point), but the memory won't be free until the end of the transaction/cursor. If the memory problem still occurs, we can easily reduce the memory usage by 3 by avoiding the use of dict and dictfetchall usages. https://github.com/odoo/odoo/pull/162390