When you want to relate a product to an attribute in order to display configuration pictures, it is necessary for the related products to be sellable and to be published. Otherwise you get an access error (version 9.0: 403 forbidden error, version 10.0: 500 internal server error). Therefore all these related products are available in the webshop for no reasons.
The product should at least not be sellable so that it does not get displayed in the webshop.
Example: I have bicycles, a bicycle consists of a frame. The frame has a type (male/female) and a color.
Now I have to publish the product "Frame" and the product "Color" in order to make the website product configurator work for the public user.
See http://34.250.33.214:8069/shop?db=interbike
Traceback:
2017-03-16 14:25:17,558 25712 INFO bp_ch_configurator werkzeug: 178.194.239.84 - - [16/Mar/2017 14:25:17] "POST /configurator/testconfigurator-1/configurationstep1-1 HTTP/1.1" 302 -
2017-03-16 14:25:18,125 25712 WARNING bp_ch_configurator openerp.addons.website.models.ir_http: 403 Forbidden:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openerp/addons/website/models/ir_http.py", line 242, in _handle_exception
response = super(ir_http, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_http.py", line 158, in _handle_exception
return request._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 786, in _handle_exception
return super(HttpRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_http.py", line 183, in _dispatch
result = request.dispatch()
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 845, in dispatch
r = self._call_function(**self.params)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 321, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 317, in checked_call
result.flatten()
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1446, in flatten
self.response.append(self.render())
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1439, in render
context=request.context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/website/models/ir_ui_view.py", line 166, in render
return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/web_editor/models/ir_ui_view.py", line 29, in render
return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_ui_view.py", line 1081, in render
return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 254, in render
return self.render_node(element, qwebcontext, generated_attributes=qwebcontext.pop('generated_attributes', ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 295, in render_node
result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 448, in render_tag_call
d[0] = self.render_element(element, template_attributes, generated_attributes, d)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
generated_attributes= name == "t" and generated_attributes or ''))
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 295, in render_node
result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 485, in render_tag_set
qwebcontext[template_attributes["set"]] = self.eval_object(template_attributes["value"], qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 198, in eval_object
return self.eval(expr, qwebcontext)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 195, in eval
raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 192, in eval
return qwebcontext.safe_eval(expr)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 104, in safe_eval
return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True)
File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 298, in safe_eval
return eval(c, globals_dict, locals_dict)
File "", line 1, in
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/custom/addons/product_configurator/models/product.py", line 209, in get_cfg_price
prices, value_ids, custom_values, pricelist)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/custom/addons/product_configurator/models/product.py", line 142, in get_components_prices
vals = self._get_option_values(value_ids, pricelist)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/custom/addons/product_configurator/models/product.py", line 134, in _get_option_values
lambda x: x.product_id.price)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5576, in filtered
return self.browse([rec.id for rec in self if func(rec)])
File "/usr/lib/python2.7/dist-packages/openerp/custom/addons/product_configurator/models/product.py", line 134, in
lambda x: x.product_id.price)
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 830, in get
self.determine_value(record)
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 930, in determine_value
record._prefetch_field(self)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3316, in _prefetch_field
result = self.read([f.name for f in fs], load='_classic_write')
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3254, in read
values[name] = field.convert_to_read(record[name], use_name_get)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5769, in getitem
return self._fields[key].get(self, type(self))
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 823, in get
return record._cache[self]
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 6149, in getitem
return value.get() if isinstance(value, SpecialValue) else value
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 39, in get
raise self.exception
QWebException: (u'Der gew\xfcnschte Vorgang kann aufgrund Sicherheitsbeschr\xe4nkungen nicht ausgef\xfchrt werden. Bitte kontaktieren Sie den System Administrator.\n\n(Dokumenten Typ: product.product, Vorgang: read)', None)