fix: Update timestamp format for metadata synchronization to match EspoCRM requirements
This commit is contained in:
@@ -320,9 +320,9 @@ class AdvowareDocumentSyncUtils:
|
|||||||
if history_hnr is not None and history_hnr != espo_hnr:
|
if history_hnr is not None and history_hnr != espo_hnr:
|
||||||
updates['hnr'] = history_hnr
|
updates['hnr'] = history_hnr
|
||||||
|
|
||||||
# Always update lastSyncTimestamp when metadata changes
|
# Always update lastSyncTimestamp when metadata changes (EspoCRM format)
|
||||||
if len(updates) > 0:
|
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
|
needs_update = len(updates) > 0
|
||||||
|
|
||||||
|
|||||||
@@ -240,8 +240,8 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext) -> None:
|
|||||||
# Extract full Windows path from watcher data
|
# Extract full Windows path from watcher data
|
||||||
full_path = windows_file.get('path', '')
|
full_path = windows_file.get('path', '')
|
||||||
|
|
||||||
# Current timestamp for sync tracking
|
# Current timestamp for sync tracking (EspoCRM format)
|
||||||
now_iso = datetime.now().isoformat()
|
now_iso = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
new_doc = await espocrm.create_entity('CDokumente', {
|
new_doc = await espocrm.create_entity('CDokumente', {
|
||||||
'name': filename,
|
'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
|
# Update document in EspoCRM with correct field names
|
||||||
ctx.logger.info(f"💾 Updating document in EspoCRM...")
|
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 = {
|
update_data = {
|
||||||
'blake3hash': blake3_hash,
|
'blake3hash': blake3_hash,
|
||||||
|
|||||||
Reference in New Issue
Block a user