Value is not updating properly

Hello everyone i am trying to set value for the field with some conditions following code,

for i in self.get(‘stp’):
if i.reading_type == ‘Quantitative’:
i.quant_acc_criteria = i.qty_range + ’ ’ + str(i.low)
if i.high:
i.quant_acc_criteria = i.quant_acc_criteria + ’ to ’ + str(i.high)
i.quant_acc_criteria = i.quant_acc_criteria +’ ’ + i.units

the above screenshot shows the range field,‘low’ field with value ‘8’ and ‘high’ field with value ‘1’ and units has ‘%’ then the ‘quant_acc_criteria’ update with above mentioned code.

if i change range field as ‘Not More Than’ then only ‘low’ field is shown and i am changing the ‘low’ field also and then i save the record after saving the ‘quant_acc_criteria’ is updated but along with ‘high’ field value is also updating…here ‘high’ field is not there after changing the range field.

What i want is need to update the current value which is in present in “range” and “low” field but values are getting updated in 'quant_acc_criteria’from the old values which is mentioned in the 1st screenshot.can any one help me out to solve this scenario.

You can try to use Custom JS for this. Some code snippets here.