From adf087f2037b16693abae6354635be9c206458c2 Mon Sep 17 00:00:00 2001 From: "Anh Thao Pham (pta)" Date: Wed, 18 Nov 2020 08:45:01 +0000 Subject: [PATCH] [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#62151 X-original-commit: 87ea687169c9a0047b41b11ab143544142c82aae Signed-off-by: Anh Thao PHAM --- addons/website_sale/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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')