From cb047d756d371708d3cc39ba3cdfbe948d34b846 Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Wed, 24 Jun 2026 21:26:36 +0530 Subject: [PATCH] Fix v2.5.1 seed email template columns --- scripts/seed_uat_data_v2_5_1.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/seed_uat_data_v2_5_1.py b/scripts/seed_uat_data_v2_5_1.py index cf031ce..bc572f7 100644 --- a/scripts/seed_uat_data_v2_5_1.py +++ b/scripts/seed_uat_data_v2_5_1.py @@ -252,9 +252,27 @@ def main() -> None: ("UAT_INVITE", "ERP Invitation", "Please accept invitation: {{ invite_url }}"), ("UAT_NOTICE", "Notice update", "Notice {{ reference_no }} requires attention"), ]: + template_label = code.replace("_", " ") upsert(email_templates, {"tenant_id": tenant_a_id, "template_code": code}, { - **common_scope, "name": code.replace("_", " "), "subject": subject, "body": body, "body_html": body, - "template_type": "system", "is_active": True, + **common_scope, + # Different ERP builds use different mandatory/template column names. + "name": template_label, + "template_name": template_label, + "title": template_label, + "subject": subject, + "email_subject": subject, + "subject_template": subject, + "template_subject": subject, + "body": body, + "body_text": body, + "body_html": body, + "html_body": body, + "template_body": body, + "content": body, + "template_content": body, + "template_type": "system", + "category": "system", + "is_active": True, }, f"email template {code}") email_queue = find_table("email_queue", "queued_emails", "mail_queue")