feat: Optimize initial sync logic and remove redundant rowId updates in sync process

This commit is contained in:
2026-02-07 22:38:53 +00:00
parent 7a7a322389
commit 709456301c
3 changed files with 466 additions and 38 deletions

View File

@@ -244,7 +244,12 @@ class BeteiligteSync:
last_sync = espo_entity.get('advowareLastSync')
espo_modified = espo_entity.get('modifiedAt')
if espo_rowid and advo_rowid and last_sync:
# SPECIAL CASE: Kein lastSync → Initial Sync (EspoCRM→Advoware)
if not last_sync:
self._log(f"Initial Sync (kein lastSync) → EspoCRM neuer")
return 'espocrm_newer'
if espo_rowid and advo_rowid:
# Prüfe ob Advoware geändert wurde (rowId)
advo_changed = (espo_rowid != advo_rowid)