From db32c972a913ef8d5410dbf96e6bb3d24a5cf1fc Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Wed, 24 Jun 2026 09:56:38 +0000 Subject: [PATCH] fix(sales): load sales_classification.js via doctype_js, not app_include_js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit app_include assets are appended to the desk's `Link: rel=preload` response header. This deployment sits behind an edge proxy with a 4 KB header buffer; the extra entry tipped the header over the limit → 502 "upstream sent too big header" on every desk request (only at the edge proxy, so it was invisible to local nginx/gunicorn curl checks). Move the checkbox mutual-exclusion script to doctype_js for Sales Invoice and Sales Order — loaded per-form, never added to the preload header. Same mechanism already documented in jey_layout/hooks.py. Co-Authored-By: Claude Opus 4.8 (1M context) --- jey_erp/hooks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jey_erp/hooks.py b/jey_erp/hooks.py index 5ab1e6c..4caab6b 100644 --- a/jey_erp/hooks.py +++ b/jey_erp/hooks.py @@ -15,7 +15,6 @@ app_include_js = [ "/assets/jey_erp/js/sales_invoice_tax_articles.js", "/assets/jey_erp/js/sales_invoice_certificates.js", "/assets/jey_erp/js/sales_order_vat.js", - "/assets/jey_erp/js/sales_classification.js", "/assets/jey_erp/js/asset.js", "/assets/jey_erp/js/link_field_fix.js", "bank_excel_import.bundle.js", @@ -27,7 +26,11 @@ app_include_css = [ ] doctype_js = { - "Sales Invoice": "public/js/sales_invoice.js", + # sales_classification.js loaded via doctype_js (NOT app_include_js) so it + # does NOT bloat the desk's `Link: rel=preload` header — the edge proxy has a + # 4 KB header buffer and overflowing it returns 502. See jey_layout/hooks.py. + "Sales Invoice": ["public/js/sales_invoice.js", "public/js/sales_classification.js"], + "Sales Order": "public/js/sales_classification.js", "Purchase Invoice": "public/js/purchase_invoice.js", "Employee": "public/js/employee.js", "Bank Reconciliation Tool": "public/js/bank_reconciliation_tool.js",