From 76a9d57b48a5627757bdb66a716efbfc0ce53bc9 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Fri, 10 Jul 2026 10:28:32 +0000 Subject: [PATCH] fix(purchase): make tax_type mandatory only for Purchase Act Purchase Invoice Item.tax_type (Tax Free / Taxable) models the 5% withholding that only applies to a Purchase Act. EQF and Import documents don't use it, but the e-taxes import now stamps purchase_type=1 on EQF invoices too, which made tax_type mandatory on every line. Narrow mandatory_depends_on to act_type == "Purchase Act". Co-Authored-By: Claude Opus 4.8 (1M context) --- jey_erp/custom_fields.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jey_erp/custom_fields.py b/jey_erp/custom_fields.py index a72d681..eb00ac3 100644 --- a/jey_erp/custom_fields.py +++ b/jey_erp/custom_fields.py @@ -1101,7 +1101,10 @@ def create_custom_fields(): # 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', + # tax_type (Tax Free / Taxable) only applies to a Purchase Act + # (5% withholding). EQF / Import documents don't use it, so it is + # mandatory only when act_type == "Purchase Act". + mandatory_depends_on='eval:parent.act_type == "Purchase Act"', in_list_view=1, columns=2 ),