From bea08279d8edae55004a1690a73a2356c94bb199 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Thu, 25 Jun 2026 09:07:47 +0000 Subject: [PATCH] feat(purchase): show/require Act Kind only for Purchase Act Add depends_on and mandatory_depends_on on the Purchase Invoice act_kind field so it is shown and mandatory only when 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 947ec0a..dbc1f85 100644 --- a/jey_erp/custom_fields.py +++ b/jey_erp/custom_fields.py @@ -552,7 +552,10 @@ def create_custom_fields(): fieldtype='Select', options='\nAgricultural Products Act\nMetal Scrap Reception Act\nTire Products For Disposal Act\nPlastic Products For Disposal Act\nRawhide Supply\nOther Product Receipt Act', insert_after='etaxes_agricultural_section', - description='Type of act for e-taxes' + description='Type of act for e-taxes', + # Shown and mandatory only for a Purchase Act. + depends_on='eval:doc.act_type == "Purchase Act"', + mandatory_depends_on='eval:doc.act_type == "Purchase Act"' ), dict( fieldname='etaxes_purchase_id',