summaryrefslogtreecommitdiff
path: root/addons/website_form
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-01-16 11:41:10 +0000
committerNicolas Martinelli <nim@odoo.com>2020-01-16 15:12:21 +0000
commit206b197cc9f1073c92018c4e0ea80722ee75f429 (patch)
tree41011f10c11558ac05beee65ce9f8820c24e61f5 /addons/website_form
parent6977f85d2f566b65b51122f944ed31516698a5d0 (diff)
[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: abc85e176e337f61926d92cdf33680037af1dd96 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/website_form')
-rw-r--r--addons/website_form/models/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/website_form/models/models.py b/addons/website_form/models/models.py
index fb4f73c39d3..c2fa9015ce1 100644
--- a/addons/website_form/models/models.py
+++ b/addons/website_form/models/models.py
@@ -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]