summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authornie <nie@odoo.com>2021-02-09 10:11:31 +0000
committernie <nie@odoo.com>2021-02-10 12:16:49 +0000
commit5a74dc2ca8aadb7d91d9cf7c047065fee3263ece (patch)
tree6c242c2357250ad780c1900fa47ff0ca2fd922c2 /addons
parent84d668ed3a1ba8ba4f61302dea011c596a07f493 (diff)
[FIX] website_form: user dynamic fields without readonly attribute
Steps: - Install studio, website_form - Go to Settings > Users & Companies > Users - Click the Studio icon - On the top bar, click Website - Click New Form - In edition mode, click the first label - Select Customize > Add an Existing Field Bug: Traceback here: https://github.com/odoo/odoo/blob/3ff00944fe6a439bd5d7bddb846206d3d6cac3a0/addons/website_form/models/models.py#L73 KeyError: 'readonly' Explanation: Dynamic selection fields don't declare a 'readonly' attribute: https://github.com/odoo/odoo/blob/3ff00944fe6a439bd5d7bddb846206d3d6cac3a0/odoo/addons/base/models/res_users.py#L1275-L1282 opw:2449356 closes odoo/odoo#65862 X-original-commit: 70d8ffbbea3db8c46e21494b6913ecb44e3a5b8d Signed-off-by: backspac <backspac@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_form/models/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_form/models/models.py b/addons/website_form/models/models.py
index 77cf3550642..30265ba8910 100644
--- a/addons/website_form/models/models.py
+++ b/addons/website_form/models/models.py
@@ -64,7 +64,7 @@ class website_form_model(models.Model):
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 or fields_get[field]['type'] == 'many2one_reference':
+ if fields_get[field].get('readonly') or field in MAGIC_FIELDS or fields_get[field]['type'] == 'many2one_reference':
del fields_get[field]
return fields_get