fix: ensure syncStatus is reset to 'synced' for unchanged files in Advoware sync process

This commit is contained in:
bsiggel
2026-03-31 10:40:14 +00:00
parent f9c8aa7c6d
commit 9639a375a6
3 changed files with 44 additions and 21 deletions

View File

@@ -333,13 +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')
now_str = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
updates['lastSyncTimestamp'] = now_str
needs_update = len(updates) > 0