From 4fc406cb17f84e7046369a17d9a35c6b39e06091 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Tue, 23 Jun 2026 11:43:23 +0000 Subject: [PATCH] fix(purchase): keep tax_type/purchase_tax_amount always visible in grid Clear depends_on on the Purchase Invoice Item tax_type and purchase_tax_amount custom fields so their grid columns are always shown (in_list_view). Mandatory state still toggles via mandatory_depends_on on tax_type. Previously depends_on hid the column and a JS hidden-toggle re-added it, which broke the grid layout. Co-Authored-By: Claude Opus 4.8 (1M context) --- jey_erp/custom_fields.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jey_erp/custom_fields.py b/jey_erp/custom_fields.py index 70ff8ac..2334f23 100644 --- a/jey_erp/custom_fields.py +++ b/jey_erp/custom_fields.py @@ -1012,7 +1012,11 @@ def create_custom_fields(): fieldtype='Select', options='\nTax Free\nTaxable', insert_after='item_tax_template', - depends_on='eval:parent.purchase_type || parent.agricultural_goods', + # Column is ALWAYS visible (in_list_view). Only the mandatory + # state toggles, via mandatory_depends_on. Previously depends_on + # hid the column and JS re-toggled `hidden`, which broke the grid + # layout — so depends_on is intentionally cleared here. + depends_on='', mandatory_depends_on='eval:parent.purchase_type || parent.agricultural_goods', in_list_view=1, columns=2 @@ -1022,7 +1026,8 @@ def create_custom_fields(): label='Purchase Tax Amount (5%)', fieldtype='Currency', insert_after='tax_type', - depends_on='eval:parent.purchase_type || parent.agricultural_goods', + # Always-visible read-only column (see tax_type note above). + depends_on='', read_only=1, in_list_view=1, columns=2,