From d78a4ee67ea3c508451169518240eafdaf5130cd Mon Sep 17 00:00:00 2001 From: bsiggel Date: Wed, 25 Mar 2026 21:37:49 +0000 Subject: [PATCH] fix: Update timestamp format for metadata synchronization to match EspoCRM requirements --- services/advoware_document_sync_utils.py | 4 ++-- src/steps/advoware_docs/document_sync_event_step.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/advoware_document_sync_utils.py b/services/advoware_document_sync_utils.py index 83e9ed7..18d8dd3 100644 --- a/services/advoware_document_sync_utils.py +++ b/services/advoware_document_sync_utils.py @@ -320,9 +320,9 @@ class AdvowareDocumentSyncUtils: if history_hnr is not None and history_hnr != espo_hnr: updates['hnr'] = history_hnr - # Always update lastSyncTimestamp when metadata changes + # Always update lastSyncTimestamp when metadata changes (EspoCRM format) if len(updates) > 0: - updates['lastSyncTimestamp'] = datetime.now().isoformat() + updates['lastSyncTimestamp'] = datetime.now().strftime('%Y-%m-%d %H:%M:%S') needs_update = len(updates) > 0 diff --git a/src/steps/advoware_docs/document_sync_event_step.py b/src/steps/advoware_docs/document_sync_event_step.py index 2a49da2..9ab33f7 100644 --- a/src/steps/advoware_docs/document_sync_event_step.py +++ b/src/steps/advoware_docs/document_sync_event_step.py @@ -240,8 +240,8 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext) -> None: # Extract full Windows path from watcher data full_path = windows_file.get('path', '') - # Current timestamp for sync tracking - now_iso = datetime.now().isoformat() + # Current timestamp for sync tracking (EspoCRM format) + now_iso = datetime.now().strftime('%Y-%m-%d %H:%M:%S') new_doc = await espocrm.create_entity('CDokumente', { 'name': filename, @@ -285,7 +285,7 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext) -> None: # Update document in EspoCRM with correct field names ctx.logger.info(f"💾 Updating document in EspoCRM...") - now_iso = datetime.now().isoformat() + now_iso = datetime.now().strftime('%Y-%m-%d %H:%M:%S') update_data = { 'blake3hash': blake3_hash,