diff --git a/src/Administration/Resources/app/administration/src/module/sw-customer/view/sw-customer-detail-addresses/index.js b/src/Administration/Resources/app/administration/src/module/sw-customer/view/sw-customer-detail-addresses/index.js index 51d7c2927f4..bdba06f1028 100644 --- a/src/Administration/Resources/app/administration/src/module/sw-customer/view/sw-customer-detail-addresses/index.js +++ b/src/Administration/Resources/app/administration/src/module/sw-customer/view/sw-customer-detail-addresses/index.js @@ -212,11 +212,12 @@ Component.register('sw-customer-detail-addresses', { }, isValidAddress(address) { + const ignoreFields = ['createdAt']; const requiredAddressFields = Object.keys(EntityDefinition.getRequiredFields('customer_address')); let isValid = true; isValid = requiredAddressFields.every(field => { - return required(address[field]); + return (ignoreFields.indexOf(field) !== -1) || required(address[field]); }); return isValid; diff --git a/src/Administration/Resources/app/administration/src/module/sw-order/component/sw-order-create-address-modal/index.js b/src/Administration/Resources/app/administration/src/module/sw-order/component/sw-order-create-address-modal/index.js index e653fa8356c..e653718a7e4 100644 --- a/src/Administration/Resources/app/administration/src/module/sw-order/component/sw-order-create-address-modal/index.js +++ b/src/Administration/Resources/app/administration/src/module/sw-order/component/sw-order-create-address-modal/index.js @@ -1,8 +1,7 @@ -import { required } from 'src/core/service/validation.service'; import template from './sw-order-create-address-modal.html.twig'; import './sw-order-create-address-modal.scss'; -const { Component, EntityDefinition, Mixin, State, Service } = Shopware; +const { Component, Mixin, State, Service } = Shopware; const { Criteria } = Shopware.Data; Component.register('sw-order-create-address-modal', { @@ -231,14 +230,6 @@ Component.register('sw-order-create-address-modal', { return; } - if (!this.isValidAddress(this.currentAddress)) { - this.createNotificationError({ - title: this.$tc('global.default.error'), - message: this.$tc('sw-customer.notification.requiredFields') - }); - return; - } - await this.saveCurrentAddress(); await this.saveCurrentCustomer(); await this.updateOrderContext(); @@ -267,17 +258,6 @@ Component.register('sw-order-create-address-modal', { newAddress.customerId = this.activeCustomer.id; this.currentAddress = newAddress; - }, - - isValidAddress(address) { - const requiredAddressFields = Object.keys(EntityDefinition.getRequiredFields('customer_address')); - let isValid = true; - - isValid = requiredAddressFields.every(field => { - return required(address[field]); - }); - - return isValid; } } });