diff --git a/app/models/product_import/entry_processor.rb b/app/models/product_import/entry_processor.rb index 66c0d40d8f..68ecf0f19d 100644 --- a/app/models/product_import/entry_processor.rb +++ b/app/models/product_import/entry_processor.rb @@ -166,6 +166,7 @@ module ProductImport product = Spree::Product.new product.assign_attributes(entry.attributes.except('id')) + product.supplier_id = entry.enterprise_id assign_defaults(product, entry) if product.save diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index a4574bffda..71d1497da7 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -207,6 +207,7 @@ module ProductImport def mark_as_new_product(entry) new_product = Spree::Product.new new_product.assign_attributes(entry.attributes.except('id')) + new_product.supplier_id = entry.enterprise_id if new_product.valid? entry.validates_as = 'new_product' unless entry.errors?