diff --git a/services/advoware_document_sync_utils.py b/services/advoware_document_sync_utils.py index 00c75f1..0af8c35 100644 --- a/services/advoware_document_sync_utils.py +++ b/services/advoware_document_sync_utils.py @@ -333,6 +333,10 @@ class AdvowareDocumentSyncUtils: if history_erstellung and history_erstellung != espo_erstellung: updates['advowareErstellungTimestamp'] = history_erstellung + # File is confirmed in-sync (SKIP = no file changes) → reset syncStatus if unclean + if espo_doc.get('syncStatus') != 'synced': + updates['syncStatus'] = 'synced' + # Always update lastSyncTimestamp when metadata changes (EspoCRM format) if len(updates) > 0: updates['lastSyncTimestamp'] = datetime.now().strftime('%Y-%m-%d %H:%M:%S')