From 544930f592c6d946caaa15e21935625119bcce5c Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 7 May 2020 08:50:58 -0700 Subject: [PATCH] [IMP] connector_opencart: Raise warning when product cannot be created/found by attributes, enable logging in upstream. --- connector_opencart/models/product/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connector_opencart/models/product/common.py b/connector_opencart/models/product/common.py index 8e0a9c0c..4d169803 100644 --- a/connector_opencart/models/product/common.py +++ b/connector_opencart/models/product/common.py @@ -37,7 +37,10 @@ class OpencartProductTemplate(models.Model): raise RetryableJobError('Order Product (%s) has option (%s) "%s" that is not mapped to an Odoo Attribute Value.' % (self, opencart_attribute_value.external_id, opencart_attribute_value.opencart_name)) selected_attribute_values += opencart_attribute_value.odoo_id # Now that we know what options are selected, we can load a variant with those options - return self.odoo_id._create_product_variant(selected_attribute_values) + product = self.odoo_id._create_product_variant(selected_attribute_values, log_warning=True) + if not product: + raise Exception('No product can be created for selected attribute values, check logs. ' + str(selected_attribute_values)) + return product class ProductTemplate(models.Model):