diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index e08360113e..06c1311d3a 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -211,7 +211,7 @@ module ProductImport reference_entry = all_entries_for_product(entry).first return if entry.variant_unit_name.to_s == reference_entry.variant_unit_name.to_s - mark_as_not_updatable(entry, "variant_unit_name") + mark_as_values_must_be_same(entry, "variant_unit_name") end def producer_validation(entry) @@ -425,6 +425,11 @@ module ProductImport error: I18n.t("admin.product_import.model.not_updatable")) end + def mark_as_values_must_be_same(entry, attribute) + mark_as_invalid(entry, attribute: attribute, + error: I18n.t("admin.product_import.model.values_must_be_same")) + end + def import_into_inventory? @import_settings.dig(:settings, 'import_into') == 'inventories' end diff --git a/config/locales/en.yml b/config/locales/en.yml index 96153edcd5..839a7fbb5d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -730,6 +730,7 @@ en: not_found: not found in database category_not_found: doesn't match allowed categories. See the correct categories to choose from on the product import page, or check that there's no misspelling. not_updatable: cannot be updated on existing products via product import + values_must_be_same: must be the same for products with the same name blank: can't be blank products_no_permission: you do not have permission to manage products for this enterprise inventory_no_permission: you do not have permission to create inventory for this producer