Skip to content
Snippets Groups Projects
Commit 206b197c authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] website_form: remove evaluated domains


- Install helpdesk_stock
- Publish the team Customer Care on the website
- Edit the ticket submission form
- Add the field 'Lot/Serial Number'

A crash occurs because of a malformed domain.

It happens because the domain is a string, and therefore should be
evaluated.

We remove the string domains since it won't be possible to evaluated
them in the website form anyway.

opw-2176144

closes odoo/odoo#43427

X-original-commit: abc85e17
Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 6977f85d
No related branches found
No related tags found
No related merge requests found
......@@ -58,8 +58,12 @@ class website_form_model(models.Model):
fields_get[field]['required'] = False
# Remove readonly and magic fields
# Remove string domains which are supposed to be evaluated
# (e.g. "[('product_id', '=', product_id)]")
MAGIC_FIELDS = models.MAGIC_COLUMNS + [model.CONCURRENCY_CHECK_FIELD]
for field in list(fields_get):
if 'domain' in fields_get[field] and isinstance(fields_get[field]['domain'], str):
del fields_get[field]['domain']
if fields_get[field]['readonly'] or field in MAGIC_FIELDS:
del fields_get[field]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment