'@param contract_id: id of hr.contract to be tested
@return: returns True if the given rule match the condition for the given contract. Return False otherwise.'

@api.multi
def satisfy_condition(self, localdict):

    self.ensure_one()
    if (self.condition_select == 'none'):
        return True
    elif (self.condition_select == 'range'):
        try:
            result = safe_eval(self.condition_range, localdict)
            return (((self.condition_range_min <= result) and (result <= self.condition_range_max)) or False)
        except:
            raise UserError((_('Wrong    range    condition    defined    for    salary    rule    %s    (%s).') % (self.name, self.code)))
    else:
        try:
            safe_eval(self.condition_python, localdict, mode='exec', nocopy=True)
            return ((('result' in localdict) and localdict['result']) or False)
        except:
            raise UserError((_('Wrong    python    condition    defined    for    salary    rule    %s    (%s).') % (self.name, self.code)))
