import frappe import json frappe.init(site="erpnext.local") frappe.connect() try: # Get current workspace content current_content = frappe.db.get_value("Workspace", "Westech", "content") content = json.loads(current_content) if current_content else [] # Create HTML block with template links html_block = '''

📋 Print Format Templates

🟣 Purple Sheet
Special Handling Log
special-handling-log
🟢 Green Sheet
R2 Special Handling Log
r2-special-handling-log
🏷️ Pallet Label
4x6" with Service Level
pallet-label-4x6
📦 R2 UW Label
Controlled Stream
r2-uw-label
⚠️ Note: These are HTML templates. To use them, create Print Formats in ERPNext with these names and paste the HTML content from /home/puddintaim/.openclaw/workspace/westech-erp/templates/
''' # Add new block at the top (after first header) template_block = { "type": "custom_block", "data": { "html": html_block } } # Find first header and insert after it insert_idx = 0 for i, block in enumerate(content): if block.get('type') == 'header': insert_idx = i + 1 break content.insert(insert_idx, template_block) # Update content directly via db.set_value (bypasses validation) frappe.db.set_value("Workspace", "Westech", "content", json.dumps(content)) frappe.db.commit() print(f"✓ Workspace 'Westech' updated successfully") print(f"✓ View at: https://erp.diagalon.com/app/westech") print(f"\nTemplate files location:") print(f" /home/puddintaim/.openclaw/workspace/westech-erp/templates/") finally: frappe.destroy()