diff --git a/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs b/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs index 9dc0a9b6..225c04a4 100644 --- a/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs +++ b/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs @@ -85,6 +85,7 @@ public override async Task SaveChangesAsync(IList models) repository.PatchRowVersion(originalEntity, modifiedOrder.RowVersion); var oldModel = originalEntity.ToModel(AbstractTypeFactory.TryCreateInstance()); + await LoadOrderDependenciesAsync(oldModel); _totalsCalculator.CalculateTotals(oldModel); // Workaround to trigger update of auditable fields when only updating navigation properties. @@ -147,6 +148,7 @@ public override async Task SaveChangesAsync(IList models) // We need to CalculateTotals for the new Order, because it is empty after entity.ToModel creation _totalsCalculator.CalculateTotals(changedModel); + await LoadOrderDependenciesAsync(changedModel); changedEntry.NewEntry = changedModel; }