'Sort Shipping Rule Conditions based on increasing From Value'

def sort_shipping_rule_conditions(self):

    self.shipping_rules_conditions = sorted(self.conditions, key=(lambda d: flt(d.from_value)))
    for (i, d) in enumerate(self.conditions):
        d.idx = (i + 1)
