@@ -241,10 +241,10 @@ def __init__(self, *args, **kwargs):
241241
242242 def onload (self ):
243243 super ().onload ()
244- tax_withholding_category = frappe .get_cached_value (
245- "Supplier" , self .supplier , "tax_withholding_category"
244+ tax_withholding_category , tax_withholding_group = frappe .get_cached_value (
245+ "Supplier" , self .supplier , [ "tax_withholding_category" , "tax_withholding_group" ]
246246 )
247- self .set_onload ("tax_withholding_category " , tax_withholding_category )
247+ self .set_onload ("apply_tds " , tax_withholding_category or tax_withholding_group )
248248
249249 if self .is_new ():
250250 self .set ("tax_withholding_entries" , [])
@@ -351,10 +351,12 @@ def set_missing_values(self, for_validate=False):
351351 template_name = self .payment_terms_template ,
352352 )
353353
354- tds_category = frappe .get_cached_value ("Supplier" , self .supplier , "tax_withholding_category" )
355- if tds_category and not for_validate :
356- self .apply_tds = 1
357- self .set_onload ("tax_withholding_category" , tds_category )
354+ tax_withholding_category , tax_withholding_group = frappe .get_cached_value (
355+ "Supplier" , self .supplier , ["tax_withholding_category" , "tax_withholding_group" ]
356+ )
357+ if not for_validate :
358+ if tax_withholding_category or tax_withholding_group :
359+ self .apply_tds = 1
358360
359361 super ().set_missing_values (for_validate )
360362
0 commit comments