diff --git a/magentoerpconnect/product.py b/magentoerpconnect/product.py index e1c8cc92c..5ab5d31f9 100644 --- a/magentoerpconnect/product.py +++ b/magentoerpconnect/product.py @@ -494,11 +494,9 @@ def categories(self, record): # OpenERP assign 'All Products' if not specified # skip main cat assignment if the current main category is already in # categ_ids - if main_categ_id: - if self.backend_record.categ_id.id not in category_ids): - result['categ_id'] = main_categ_id - else: - result['categ_id'] = self.backend_record.categ_id.id + if (main_categ_id and + self.backend_record.categ_id.id not in category_ids): + result['categ_id'] = main_categ_id return result @mapping