[FIX] pos_self_order_sale: check if the field really exists
When the module "sale_product_configurator" is not installed, an AttributeError is raised Steps to reproduce: Install the "point_of_sale" app, the "pos_self_order_sale" module and remove the "sale_product_configurator" module Go to settings -> point of sale -> Self ordering: QR Menu -> preview web interface Cause: The field "optional_product_ids" is provided by the module "sale_product_configurator" which is not a dependency of this module opw-3850421 closes odoo/odoo#161921 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
@@ -9,5 +9,8 @@ class ProductProduct(models.Model):
|
||||
def _get_product_for_ui(self, pos_config):
|
||||
self.ensure_one()
|
||||
product = super()._get_product_for_ui(pos_config)
|
||||
product["optional_product_ids"] = self.optional_product_ids.product_variant_ids.ids
|
||||
|
||||
if "optional_product_ids" in self.env["product.product"]:
|
||||
product["optional_product_ids"] = self.optional_product_ids.product_variant_ids.ids
|
||||
|
||||
return product
|
||||
|
||||
Reference in New Issue
Block a user