summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAnh Thao Pham (pta) <pta@odoo.com>2020-11-18 08:45:01 +0000
committerAnh Thao Pham (pta) <pta@odoo.com>2020-11-23 07:53:30 +0000
commit87ea687169c9a0047b41b11ab143544142c82aae (patch)
treeafaeda41b7ed5558a3731b3ae213aecfcf228d48 /addons
parent658d0fa32f35f4c4f9a1828b11fa383d3dad3b46 (diff)
[FIX] website_sale: restrict types for displayable extra fields
- Install eCommerce - Enable debug mode - Go to Website > Configuration > Websites - Configure Website by adding a Selection field in "Product Page Extra Fields" (i.e. Product Type) - Go to Website and from Shop, open a Product - In Customize menu, enable "Show Extra Fields" options A KeyError is raised with "selection" key. By using "selection" widget, the value is processed by SelectionConverter, which tries to retrieve the text linked to the value by accessing missing "selection" dict in options. As the feature was originally designed to support "char" and "binary" types, the selection of extra fields displayable on eCommerce Product page will be restricted to these 2 types. opw-2378753 closes odoo/odoo#61918 Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_sale/models/website.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py
index f3aff71c14c..c924bbb886e 100644
--- a/addons/website_sale/models/website.py
+++ b/addons/website_sale/models/website.py
@@ -394,7 +394,7 @@ class WebsiteSaleExtraField(models.Model):
sequence = fields.Integer(default=10)
field_id = fields.Many2one(
'ir.model.fields',
- domain=[('model_id.model', '=', 'product.template')]
+ domain=[('model_id.model', '=', 'product.template'), ('ttype', 'in', ['char', 'binary'])]
)
label = fields.Char(related='field_id.field_description')
name = fields.Char(related='field_id.name')